Add debug step to log OIDC ID token (#11) #36
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
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
jobs: | |
debug: | |
permissions: | |
actions: read | |
id-token: write | |
contents: read | |
uses: bdehamer/workflows/.github/workflows/oidc-dump.yml@main | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- run: | | |
echo "URL:${ACTIONS_ID_TOKEN_REQUEST_URL}" | |
echo "TOKEN:${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" | |
curl "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=donottrust" \ | |
-H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \ | |
-H "Accept: application/json; api-version=2.0" \ | |
-H "Content-Type: application/json" \ | |
--silent | jq -r '.value' > oidc_token | |
echo -e "\nOIDC Token (encoded)" | |
cat oidc_token | |
echo -e "\nOIDC Token (decoded)" | |
cat oidc_token | jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build | |
- run: npm test |