Git variables are not available with skipDefaultCheckout()

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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not A Defect
    • Priority: Minor
    • Component/s: git-plugin
    • Environment:
      Jenkins 2.303.1 in k8s deployed from Helm chart
      Git plugin 4.8.2

      If I set in Jenkinsfile (pipeline job):

      options { skipDefaultCheckout() }}}{{

      then in steps in pipeline below, variable ${env.GIT_URL} appeared do not available. For example cannot complete step:

      {{stage('Clean checkout') {
      steps {
      checkout([$class: 'GitSCM', branches: [[name: "master"]],
      userRemoteConfigs: [[url: "${env.GIT_URL}"]]])
      }
      }}}

      in this step variable ${env.GIT_URL} = null due to build console log.

      But if you enable back default checkout, so delete:

      options { skipDefaultCheckout() }}}{{

      Then ${env.GIT_URL} became available. Is it expected behaviour?

            Assignee:
            Unassigned
            Reporter:
            Valeriy Zabawski
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: