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

Git variables are not available with skipDefaultCheckout()

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-plugin
    • None
    • 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?

            Unassigned Unassigned
            dziki_jam Valeriy Zabawski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: