Skip to content

ci(release): fall back to NPM_TOKEN when Trusted Publishers isn't configured#29

Closed
aaronstevenwhite wants to merge 1 commit into
mainfrom
ci/npm-token-fallback
Closed

ci(release): fall back to NPM_TOKEN when Trusted Publishers isn't configured#29
aaronstevenwhite wants to merge 1 commit into
mainfrom
ci/npm-token-fallback

Conversation

@aaronstevenwhite

Copy link
Copy Markdown
Contributor

Follow-up to #28. The bundled-npm and corepack issues are fixed (npm 11.13.0 is now invoked successfully via the fetched tarball), but the publish still 404s because npm 11's clearer error message (do not have permission to access) reveals the npmjs.com Trusted Publishers allowlist for @idiolect-dev/schema does not include this repo + workflow yet. The 0.2.0 release shipped via classic NPM_TOKEN, which is still configured. This PR branches the publish step on whether the secret is present so the release ships while the allowlist is set up.

…figured

The 0.3.0 npm publish keeps 404'ing with "do not have permission to
access" because npmjs.com/package/@idiolect-dev/schema/access has
not been allowlisted for this repo + workflow under Trusted
Publishers. The previous (0.2.0) release shipped via classic
NPM_TOKEN auth, which is still configured as a repo secret.

This commit branches the publish step on whether NPM_TOKEN is set:
present means token auth (no provenance), absent means Trusted
Publishers (with provenance). When the package owner adds the
allowlist entry the secret can be removed and the OIDC path takes
over automatically.
@aaronstevenwhite

Copy link
Copy Markdown
Contributor Author

Superseded by #30. With Trusted Publishers configured on npmjs.com, the OIDC path in release.yml is sufficient and a token fallback would just add an unused secret + dead code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant