Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66331

Inaccurate documentation about GIT_COMMIT environment variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      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.

            Unassigned Unassigned
            maxb Max
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: