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

The GIT_URL environmente variable contains user name after update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 921.v6a_215c8b_f095

      After a plugin upgrade, the GIT_URL env variable seems to include the user name configured in the used Jenkins credential for the repo.

      I'm doing some command line git stuff in a script step like this:

      withCredentials([usernameColonPassword(credentialsId: 'bitbucketuser', variable: 'USERPASS')]) {
        script {
          stdout = bat(returnStdout: true, script: "@git.exe push https://${USERPASS}@${env.GIT_URL.split('://')[1]} --tags")
        } // script
      } // withCredentials
      

      Before the plugin changes, this worked fine, but after, the url git tries to push to, contains two @ characters.

      Pipeline step from build done before the plugin change: @git.exe push https://${USERPASS}@bitbucket.org/Organization/repo.git --tags

      Pipeline step from (failing) build done after the plugin change: @git.exe push https://${USERPASS}@johndoe@bitbucket.org/organization/repo.git --tags

        1. jenkins_plugins.txt
          3 kB
        2. plugins.txt
          5 kB
        3. run-jenkins.sh
          0.9 kB

            nfalco Nikolas Falco
            matthiesenj Jesper Matthiesen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: