Context
This question relates to multibranch pipelines where the behaviour merges the PR with the target branch revision (see screenshot of settings)
In this case, the merge may cause a new merge commit. So for a trigger with a given commit from a repository:
We actually get a different value of the GIT_COMMIT
envvar:
If a tool (such as a build reporting tool) needs to use the GIT_COMMIT
envvar to pass information onto a service, it cannot then be linked back to the actual commit from the project (this is a screenshot from Bitbucket but this would be the same for any repo hosting service):
Question
How, in a pipeline step, can I find the commit 709502c
is the actual genesis of this build, when the GIT_COMMIT
is set to 6781a3d1
(which is not an actual commit in the project)?