Inaccurate documentation about GIT_COMMIT environment variable

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      https://github.com/jenkinsci/workflow-cps-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly says:

      SCM-specific variables such as <code>GIT_COMMIT</code> are not automatically defined as environment variables

       

      However with today's stable Jenkins (2.289.3) and plugins, running this Jenkinsfile:

      pipeline {
          agent any
          stages {
              stage('Stage') {
                  steps {
                      sh 'echo $GIT_COMMIT'
                  }
              }
          }
      }

      does print out the Git commit, showing the documentation is inaccurate.

            Assignee:
            Unassigned
            Reporter:
            Max
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: