-
Bug
-
Resolution: Unresolved
-
Major
-
None
env.GIT_COMMIT is overwritten when pull lib (lib and code in the same repo)
SharedLibrary put in the same code repo, different branch named xxx_lib, and after Declarative: Checkout SCM, can not get the right GIT_COMMIT, always be the xxx_lib's last commit, not the code's commit
I create example repo to this issue: https://github.com/bonfy/JENKINS-61317
Jenkinsfile in master branch Last commit: 39f25e1a
library in jenkins-lib branch Last commit: a8c235b1
and when echo GIT_COMMIT, it is overwitten by lib's commit
16:55:47 stage 1
[Pipeline] echo
16:55:47 GIT COMMIT : a8c235b10c55e2f065293b1c1ad9b3bffd45d9d9
[Pipeline] echo
16:55:47 GIT BRANCH : jenkins-lib
[Pipeline] echo
16:55:48 Hello world
Please provide an example pipeline which shows the issue using a publicly accessible git repository.