Skip to content

Commit 517c4d3

Browse files
Mao Nakamotoclaude
andcommitted
ci: OIDC cannot do the first publish — keep a token for it
Same fix as ai-forms, before hitting the same failure. Trusted publishing is configured per package on npmjs.com and cannot be configured for a package that has never been published, so the token-free workflow fails on the first release with E404 on the PUT. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 4856fb0 commit 517c4d3

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ jobs:
3838
exit 1
3939
fi
4040
41-
# No token: id-token above lets the CLI exchange a short-lived OIDC
42-
# credential with npm. Provenance is generated automatically for a public
43-
# package from a public repo, so --provenance is not needed either.
41+
# OIDC (id-token above) is the preferred credential and needs no secret.
42+
# But trusted publishing is configured per package on npmjs.com, and a
43+
# package that has never been published cannot have it configured — so
44+
# OIDC alone cannot do the FIRST publish. Confirmed on ai-forms: the
45+
# provenance statement was signed and logged to sigstore, then the PUT
46+
# returned E404 "could not be found or you do not have permission",
47+
# which reads like a missing package rather than a missing credential.
48+
#
49+
# NPM_TOKEN covers only that first publish. Once this package exists and
50+
# a trusted publisher is configured, npm prefers OIDC and the secret can
51+
# be deleted.
4452
- run: npm publish
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)