Skip to content

Commit 7cb5641

Browse files
committed
ci(astro): remove one-shot OIDC claim debug step
Diagnostic step served its purpose — confirmed the OIDC claims were correct all along; the real issue was Node 22's npm 10.x lacking OIDC exchange support (fixed by pinning to Node 24). 0.1.1 published successfully via OIDC with provenance attestation. Reverting the debug step keeps the workflow lean for future runs.
1 parent c37d961 commit 7cb5641

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

.github/workflows/publish-astro.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,6 @@ jobs:
114114
- name: Build
115115
run: npm run build --workspace=astro
116116

117-
# One-shot diagnostic: dump the OIDC token's claims (just the JWT
118-
# payload, NOT the signed token itself, so it's safe to log) so we
119-
# can compare claims-as-seen-by-npm against the Trusted Publisher
120-
# config on npmjs.com. Remove this step once OIDC publish is
121-
# confirmed working.
122-
- name: Debug OIDC claims
123-
run: |
124-
set -euo pipefail
125-
# Request a token scoped to npm registry's expected audience.
126-
# The token request URL + bearer come from GH-injected env vars
127-
# only available because permissions.id-token: write is set.
128-
RESP=$(curl -sSL -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
129-
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=npm:registry.npmjs.org")
130-
TOKEN=$(echo "$RESP" | node -e 'let s=""; process.stdin.on("data",d=>s+=d).on("end",()=>{console.log(JSON.parse(s).value)})')
131-
# Decode the JWT payload (middle segment). DO NOT echo $TOKEN.
132-
PAYLOAD=$(echo "$TOKEN" | cut -d. -f2)
133-
# Pad base64url to a multiple of 4 so `base64 -d` accepts it.
134-
PAD=$((4 - ${#PAYLOAD} % 4))
135-
if [ $PAD -ne 4 ]; then PAYLOAD="${PAYLOAD}$(printf '%*s' $PAD | tr ' ' '=')"; fi
136-
# base64url → base64 (replace - / _)
137-
PAYLOAD=$(echo "$PAYLOAD" | tr '_-' '/+')
138-
echo "$PAYLOAD" | base64 -d | node -e 'let s=""; process.stdin.on("data",d=>s+=d).on("end",()=>{const c=JSON.parse(s); const keep=["aud","iss","sub","repository","repository_owner","repository_id","workflow","workflow_ref","job_workflow_ref","ref","event_name","environment","actor"]; for (const k of keep) if (k in c) console.log(k+": "+JSON.stringify(c[k]));})'
139-
140117
- name: Bump version
141118
id: bump
142119
run: |

0 commit comments

Comments
 (0)