Skip to content

Commit 58d7680

Browse files
authored
Add debug step to log OIDC ID token (#11)
* Add debug step to log OIDC ID token Debugging failed publish: https://github.com/hmarr/openai-chat-tokens/actions/runs/6158865192/job/16712551344 * Update ci.yml * Update ci.yml
1 parent 464b641 commit 58d7680

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@ on:
66
pull_request:
77

88
jobs:
9+
debug:
10+
permissions:
11+
actions: read
12+
id-token: write
13+
contents: read
14+
uses: bdehamer/workflows/.github/workflows/oidc-dump.yml@main
915
build:
1016
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
1119
steps:
20+
- run: |
21+
echo "URL:${ACTIONS_ID_TOKEN_REQUEST_URL}"
22+
echo "TOKEN:${ACTIONS_ID_TOKEN_REQUEST_TOKEN}"
23+
curl "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=donottrust" \
24+
-H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
25+
-H "Accept: application/json; api-version=2.0" \
26+
-H "Content-Type: application/json" \
27+
--silent | jq -r '.value' > oidc_token
28+
echo -e "\nOIDC Token (encoded)"
29+
cat oidc_token
30+
echo -e "\nOIDC Token (decoded)"
31+
cat oidc_token | jq -R 'split(".") | .[0],.[1] | @base64d | fromjson'
1232
- uses: actions/checkout@v3
1333
- name: Use Node.js ${{ matrix.node-version }}
1434
uses: actions/setup-node@v3

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ on:
33
release:
44
types: [created]
55
jobs:
6+
debug:
7+
permissions:
8+
actions: read
9+
id-token: write
10+
contents: read
11+
uses: bdehamer/workflows/.github/workflows/oidc-dump.yml@main
612
build:
713
runs-on: ubuntu-latest
814
permissions:

0 commit comments

Comments
 (0)