How can I get the github API endpoint and scan-credentials id inside my pipeline Jenkinsfile to run Github API request.
I am using github organization folder plugin.
You use the "withCredentials" to expose the secrets. (Obviously echoing the secret out would be a bad way to keep it secret - but you could pass that secret on to other things that didn't print it out...)
withCredentials([[$class : 'StringBinding',
credentialsId : 'my_secret_token',
variable: 'GHE_TOKEN',
]]) {
echo "I can access my secret token of ${env.GHE_TOKEN} now"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With