Jenkins Git Environment variables not set in Pipeline
问题 I am trying to read some environment variables in Jenkins pipeline script that should be set by Git plugin, but it seems they are not set, because when I tried to use in script its value is empty string and also if I use sh 'printenv' I can see that they are not set. Probably I am missing something but I cannot find what. Any idea? 回答1: Per this page: http://JenkinsURL/pipeline-syntax/globals: SCM-specific variables such as GIT_COMMIT are not automatically defined as environment variables;