Add custom payload template to webhooks
requested to merge gitlab-community/gitlab-org/gitlab:362504-support-custom-payloads-for-webhooks into master
What does this MR do and why?
This adds the ability to create a custom webhook payload template using mustache-like syntax.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
bin/rails runner "Feature.enable(:custom_webhook_template)"
- Open https://public.requestbin.com/r and copy the endpoint url
- Create a new webhook and use the copied url
- Add a custom webhook template (for example:
{"event":"{{object_kind}}"}
) - Save the webhook
- Test the webhook and check the requestbin for the incoming request (check that the body is
{"event":"push"}
for example)
Related to #362504 (closed)
Edited by Niklas van Schrick