Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Duplicate
-
Component/s: pipeline
-
Labels:None
-
Similar Issues:
Description
During old style jenkins jobs I can easily print current commit ID (e.g. GIT_COMMIT, SVN_REVISION) to the console.
But when I want to use it in Jenkinsfile (multi-branch pipeline)I tried
env.GIT_COMMIT
It gives me null/empty output.
Commit hash might be useful for informing some revision software about build that succeeded or failed (e.g. I want to use it to ping Atlassian Stash about my build).
I think this is one of the basic SCM information that should be available (just like current branch name in env.BRANCH_NAME).
Attachments
Issue Links
- duplicates
-
JENKINS-26100 SCM steps should return revision state
-
- Resolved
-
I have a less than ideal workaround: