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

GIT_URL contains user name and @ after plugin update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None

      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. run-jenkins.sh
          0.9 kB
        2. plugins.txt
          5 kB
        3. jenkins_plugins.txt
          3 kB

            Unassigned Unassigned
            matthiesenj Jesper Matthiesen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: