add merge_commit_sha to Cause
Issue
Context
- Gitlab plugin version: 1.4.6
- Gitlab version: 9.3.10
- Jenkins version: 1.6.x
- Job type: Pipeline
Logs & Traces
None
Problem description
When merging an MR, GitLab sends the merge_commit_sha as part of the WebHook:
{
"object_kind": "merge_request",
…
"object_attributes": {
…
"merge_commit_sha": "eaafb2a11e5cbd08ba46dee9540275136c86e590",
},
…
}
It would be awesome if that would be available as part of the injected environment variables.
@evgeni is merge_commit_sha not equivalent to the gitlabAfter env var?
@omehegan nope. As far as I can see, gitlabAfter comes from the after keyword in the push/tag_push hook, but not in the merge_request hook. So while I think the hash would be the same, it is part of a different webhook (and in our setup we only look at merge_request and note hooks).
@evgeni ok, noted. I will look at adding this, it should be possible.
One year passed, this 'merge_commit_sha' is still not available in the environment variables. It's very impotant because it's the base key to tell the differences in a merge.
@omehegan Any update here? We could also use this as our flow currently only looks at Merge Requests. We could make the flow include pushes, but that requires extra filtering and logic, whereas this would just be nice and simple.
ok, noted. I will look at adding this, it should be possible.
@omehegan I need this feature so I'd like to implement it - could you briefly point me places where should I do it, please? It would be very helpful.