Skip to content

fix(ci): revert to sed approach — OIDC Trusted Publishers now configured - #1094

Merged
lane711 merged 7 commits into
mainfrom
fix/publish-oidc-userconfig
Sep 9, 2026
Merged

lane711 merged 7 commits into
mainfrom
fix/publish-oidc-userconfig

Conversation

@lane711

@lane711 lane711 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reverts the manual OIDC token fetch (wrong approach — npm exchanges the token internally)
  • Goes back to removing _authToken from npmrc via sed, which lets npm auto-detect and perform the OIDC exchange with the registry
  • Previously this returned ENEEDAUTH because no Trusted Publisher was configured on the packages; now that both @sonicjs-cms/core and create-sonicjs have Trusted Publishers set up on npmjs.com, npm's automatic OIDC detection should work

Test plan

  • Merge and trigger publish workflow — expect publish to succeed for both packages

🤖 Generated with Claude Code

lane711 and others added 6 commits September 8, 2026 18:43
npm config delete targets the wrong file; setup-node writes to
$NPM_CONFIG_USERCONFIG. Use sed directly on that file to remove
the _authToken line so npm's OIDC exchange can authenticate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without registry-url, NPM_CONFIG_USERCONFIG is unset and the sed step
fails. Add registry-url back (needed for OIDC exchange to work via npm),
guard the sed+cat with a file-existence check to handle both cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
npm CLI does not automatically exchange OIDC tokens — it must be explicitly
fetched and set as NODE_AUTH_TOKEN. setup-node already writes
_authToken=${NODE_AUTH_TOKEN} to the npmrc; populating the env var with the
OIDC JWT lets the registry validate it against the Trusted Publisher config.

Replaces the sed-based _authToken removal with an explicit OIDC token fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…configured

Previously ENEEDAUTH because no Trusted Publisher was configured on the packages.
Now that both @sonicjs-cms/core and create-sonicjs have Trusted Publishers set up
on npmjs.com, removing _authToken from the npmrc lets npm auto-detect and exchange
the OIDC token automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lane711
lane711 merged commit 4313f87 into main Sep 9, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
internal — b1553db1 Deployed Sep 9, 2026 by lane711 via authorize #1593
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