- Windows 10 PC as a master device.
- Jenkins LTS controller 2.375.1
- Firefox browser.
Previously, on a Freestyle project, I was able to call
%GIT_COMMIT% as an environment variable in a Windows batch script and it would display the commit hash.
Having moved to a Pipeline project, the
GIT_COMMIT environment variable doesn’t currently exist, and the Pipeline syntax global variables documentation specifies:
SCM-specific variables such as
GIT_COMMITare not automatically defined as environment variables; rather you can use the return value of the checkout step.
How would one go about this?
Looked this up several times and all the answers all seem very confusing, and this community is so helpful so thought I’d ask!