This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# What happens here? | |
# Build the JWT structure | |
# Call GH API using the JWT returning the token | |
# get a temporary jwt token from the key file and app id (hardcoded in the file:) | |
generated_jwt=$(./github-app-jwt.sh) | |
github_api_url="https://api.github.com/app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://stackoverflow.com/questions/34795050/how-do-i-list-all-of-my-jenkins-credentials-in-the-script-console | |
// To be used at a jenkins_instance_url/script, example https://jenkins.corp.net/script | |
import java.nio.charset.StandardCharsets; | |
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class | |
) | |
for (c in creds) { | |
println(c.id) |