Pass webhook POST body to the trigger CI job
When triggering a pipeline using a webhook the payload is lost in the way, in some cases the payload carries important information that can determine how the triggered pipeline should work. in this release, we've added a new predefined variable to capture the webhook body so it can be kept and be used in the triggered pipeline.
Problem to solve
At the moment you can trigger a pipeline in a different project or the same project based on webhooks. The only problem is that the body that get's posted on the trigger gets lost in the process and can't be retrieved from the CI job that get's triggered.
A use-case for us would be:
On each project we could add a webhook on the merge request events. Within the Settings --> Integration we could add a URL to a different GitLab project, for example https://gitlab.example.com/api/v4/projects/9/ref/master/trigger/pipeline?token=TOKEN.
The trigger job on that project should have the body of the webhook passed into it. So within that job we could analyze the body from the webhook and based on some values to or maintaince tasks or other nice things.
Pass the webhook body to the triggered job. as a file type variable
What does success look like, and how can we measure that?
The webhook body should be passed to the trigger job