Created
November 11, 2024 04:37
-
-
Save lox/9be38faf57ca0400b63a19070773593e to your computer and use it in GitHub Desktop.
Example Buildkite Pipeline to Print OIDC Token
This file contains hidden or 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
steps: | |
- label: ":key: Test OIDC Token" | |
command: | | |
# Request an OIDC token | |
echo "--- :buildkite: Requesting OIDC token" | |
BUILDKITE_OIDC_TOKEN="$(buildkite-agent oidc request-token)" | |
echo "--- :mag: Token details" | |
# Print token (redacted in logs for security) | |
echo "Token: \$BUILDKITE_OIDC_TOKEN" | |
# Decode and print token payload (base64 decoded) | |
echo "Decoded payload:" | |
echo \$BUILDKITE_OIDC_TOKEN | cut -d. -f2 | base64 -d | jq . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment