Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook payload #1196

Closed
axeloz opened this issue Mar 10, 2017 · 4 comments
Closed

Webhook payload #1196

axeloz opened this issue Mar 10, 2017 · 4 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@axeloz
Copy link

axeloz commented Mar 10, 2017

  • Gitea version (or commit ref): 1.1.0

Description

I'm using Deployer (https://github.com/REBELinBLUE/deployer) which starts a deployment using Gitea's webhooks when some commits are pushed on the master branch.
It used to work quite fine but something broke lately. Then I realized that the Gitea webhook payload is:

Request URL: https://deploy.xxxx.io/deploy/LJKmBKGVY7YZzOJyHr981wFfm9j0QSdje5LOnXtXdD8j0vzdcInHGaO6YaXU?source=Gitea&url=https://git.xxx..io/agence/maison&branch=master&update_only=true
Request method: POST
Content-Type: application/json
X-Github-Delivery: c3d0f67f-e9c4-4e5e-b03d-af12a6d54c04
X-Github-Event: push
X-Gogs-Delivery: c3d0f67f-e9c4-4e5e-b03d-af12a6d54c04
X-Gogs-Event: push 

I didn't see X-Github-Delivery nor X-Github-Event before today. I think these headers have been added recently to the payload?

The deployer now thinks that the webhook is coming out of Github and is therefore doing some special treatments for Github instead of using the Gitea driver.
The deployer checks the presence of the Gogs* or the Github* or the Gitlab*, ... headers and loads the appropriate driver.

Is there a reason of this?
Thanks

REBELinBLUE/deployer#334

Screenshots

If this issue involves the Web Interface, please include a screenshot

@lunny
Copy link
Member

lunny commented Mar 10, 2017

see 79ab69f

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Mar 10, 2017
@axeloz
Copy link
Author

axeloz commented Mar 10, 2017

I see. Makes something work but breaks something else :-)
Is there any solution here?

@lunny
Copy link
Member

lunny commented Mar 10, 2017

You can adjust your check sequence, if you check X-Gogs-Delivery before X-GitHub-Delivery, it should be OK.

@axeloz
Copy link
Author

axeloz commented Mar 10, 2017

Yes, it should be OK, but this is not very clean code. Thanks anyways

@axeloz axeloz closed this as completed Mar 10, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

2 participants