Skip to content

Commit 47f300f

Browse files
MajorTalclaude
andcommitted
ci(publish): use shell unset for GH-Actions OIDC env
`env: VAR: ""` only sets the var to empty string and keeps it defined in the process env. GitHub appears to inject ACTIONS_ID_TOKEN_REQUEST_* through a channel that bypasses step-level env overrides (the workflow log showed our empty values but the runtime SDK still read non-empty URLs and made the fetch call). Use shell `unset` which actually removes the vars from the bash process env before npm test forks. Also unset GITHUB_ACTIONS so `hasGithubActionsOidcEnv()` short-circuits to false on the first check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1c1ed94 commit 47f300f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ jobs:
125125
# ACTIONS_ID_TOKEN_REQUEST_URL / _TOKEN. The CLI's `deploy apply`
126126
# detects those vars as "running in GitHub Actions CI" and takes
127127
# the OIDC-federation code path — which calls a real token-exchange
128-
# endpoint not handled by the e2e mockFetch. Unset them on the test
129-
# step ONLY; the publish steps below still need them to mint the
130-
# OIDC token for the npm Trusted Publisher exchange.
131-
env:
132-
ACTIONS_ID_TOKEN_REQUEST_URL: ""
133-
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ""
134-
run: npm test
128+
# endpoint not handled by the e2e mockFetch. `env: VAR: ""` sets the
129+
# var to an empty string but keeps it defined (and some code paths
130+
# see them via different channels); using shell `unset` actually
131+
# removes them from the process env before npm test forks. The
132+
# publish steps below still inherit the workflow-level OIDC env
133+
# because they don't run through this shell.
134+
run: |
135+
unset ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_ID_TOKEN_REQUEST_TOKEN GITHUB_ACTIONS
136+
npm test
135137
136138
- name: Bump version (lockstep)
137139
id: bump

0 commit comments

Comments
 (0)