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

credentials set via 'withCredentials' block isn't accesible from 'env'

    Details

    • Similar Issues:

      Description

      Unclear if it's in workflow or in credentials-binding plugin.

      During an engagement, I found that the following ugly but seemingly valid workflow script doesn't let me acess the value of the secret:

      def credential(name) {
        def v;
        withCredentials([[$class: 'StringBinding', credentialsId: name, variable: 'foo']]) {
            v = env.foo;
        }
        return v
      }
      
      node {
        echo credential("idOfSecretText")
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: