In a stage I can do the following: 

stage ("Merge pull request") {
         environment {
            JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
         }
         ...
         ...
         steps {
  
         }
}

Can this done also in post?

post {
     success {
         environment {         
             JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
     }

     script {
     
     }
  }
}
    

Or is there any other way to ahchieve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3dbaa1ef-96c3-4067-8cc3-00d3a1b8452b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to