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

The GIT_URL environmente variable contains user name after update

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

          [JENKINS-73250] The GIT_URL environmente variable contains user name after update

          Jesper Matthiesen created issue -
          Jesper Matthiesen made changes -
          Description Original: 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:
          {code:groovy}
          withCredentials([usernameColonPassword(credentialsId: 'bitbucketuser', variable: 'USERPASS')]) {
            script {
              stdout = bat(returnStdout: true, script: "@git.exe push https://${USERPASS}@${env.GIT_URL.split('://')[1]} --tags 2>&1")
            } // script
          } // withCredentials
          {code}

          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 2>&1}}

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


          New: 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:
          {code:groovy}
          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
          {code}

          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 2>&1}}


          Jesper Matthiesen made changes -
          Description Original: 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:
          {code:groovy}
          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
          {code}

          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 2>&1}}


          New: 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:
          {code:groovy}
          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
          {code}

          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}}


          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Attachment New: plugins.txt [ 62666 ]
          Mark Waite made changes -
          Attachment New: run-jenkins.sh [ 62667 ]
          Jesper Matthiesen made changes -
          Attachment New: jenkins_plugins.txt [ 62670 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue is duplicated by JENKINS-73796 [ JENKINS-73796 ]
          Allan BURDAJEWICZ made changes -
          Component/s New: bitbucket-branch-source-plugin [ 21428 ]
          Nikolas Falco made changes -
          Assignee New: Nikolas Falco [ nfalco ]
          Nikolas Falco made changes -
          Summary Original: GIT_URL contains user name and @ after plugin update New: The GIT_URL environmente variable contains user name after update

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

              Created:
              Updated:
              Resolved: