feat(triggers): add action field to git triggers context #693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When dealing with webhook git triggers the event of the webhook does not reach the pipeline contexts. This PR makes this event available in the contexts of the pipeline execution.
This should no affect the current conditional for matching pipelines (source, project, slug, branch), it is just informative like the hash field.
For example: allowing only github events where someone open/close a pull request using check preconditions, or if there is github push event follow a different branch in the pipeline, instead of one for pull request events.
For bitbucket server I used the header X-Event-Key
For bitbucket cloud I used the header X-Event-Key
For gitlab I used the field in the payload named object_kind
For github at the moment only supports push and PR, so I used the field named action of the payload.
related to spinnaker/orca#3269