-
Notifications
You must be signed in to change notification settings - Fork 952
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
Add support for custom webhook headers #1951
Add support for custom webhook headers #1951
Conversation
@svanharmelen - This PR should be ready for review when you have a moment! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I acknowledge this feels weird *[]*HookCustomHeader
, but it allows you to make a difference between an empty slice and no value set at all which in some API is needed. So for consistence sake I want to use this pattern in all option structs.
@svanharmelen - No problem at all, I completely understand! All changes are made 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @PatrickRice-KSC 👍🏻
With 17.1, GitLab now supports the ability to set custom headers on webhooks.
See the API documentation here:
Project:
Add/Edit: https://docs.gitlab.com/ee/api/projects.html#edit-project-hook
Set Header: https://docs.gitlab.com/ee/api/projects.html#set-a-custom-header
Delete Header: https://docs.gitlab.com/ee/api/projects.html#delete-a-custom-header
Group:
Add/Edit: https://docs.gitlab.com/ee/api/groups.html#add-group-hook
Set Header: https://docs.gitlab.com/ee/api/groups.html#set-a-custom-header
Delete Header: https://docs.gitlab.com/ee/api/groups.html#delete-a-custom-header
Note that the
value
of the header will never come back from the API, you can only ever set it (with these APIs).Note: Ignore the branch name please; I was intending to submit Group hooks as a separate PR, but just ended up adding it here so they could share the underlying structs in a couple cases :)