feat(ci): integrate OIDC-enabled changesets-action fork #678
+6
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the custom publishing workaround (from #677) with a forked
changesets-actionthat natively supports npm OIDC trusted publishing. This provides a cleaner, more integrated solution.Background
After extensive debugging (PRs #671-677), we discovered that the official
changesets/actiondoesn't support npm's OIDC trusted publishing feature (see changesets/action#515). PR #677 implemented a workaround using custom publishing steps.This PR replaces that workaround with a properly OIDC-enabled fork.
Changes
Updated Action Reference
Fork: https://github.com/GarthDB/changesets-action
Fork PR: GarthDB/changesets-action#2
Enabled OIDC Mode
Removed Custom Publishing Workaround
Deleted the separate "Publish to npm with OIDC" step since the fork handles publishing internally with proper OIDC support.
How It Works
The forked action includes these enhancements:
Validates OIDC environment automatically:
.prototools)id-token: writepermission ✅ (already configured)NPM_TOKENset ✅ (removed in previous PRs)Skips
.npmrccreation whenoidcAuth: true, allowing npm's native OIDC auto-detection to workMaintains full backward compatibility with legacy
NPM_TOKENauthenticationProvides clear error messages if OIDC requirements aren't met
Benefits
steps.changesets.outputs.publishedfor notificationsArchitecture
flowchart TD Start[Workflow Start] --> Setup[Setup npm 11.6.2] Setup --> Build[Build packages] Build --> Fork[GarthDB/changesets-action] Fork --> Validate[Validate OIDC Environment] Validate --> CheckVer{npm >= 11.5.1?} CheckVer -->|Yes| CheckPerm{id-token: write?} CheckVer -->|No| Fail1[Error: Upgrade npm] CheckPerm -->|Yes| CheckToken{NPM_TOKEN set?} CheckPerm -->|No| Fail2[Error: Add permission] CheckToken -->|No| SkipNpmrc[Skip .npmrc creation] CheckToken -->|Yes| Fail3[Error: Conflicting auth] SkipNpmrc --> HasChanges{Has changesets?} HasChanges -->|Yes| CreatePR[Create/Update Version PR] HasChanges -->|No| Publish[Run pnpm release] Publish --> NpmOIDC[npm auto-detects OIDC] NpmOIDC --> Provenance[Publish with provenance] CreatePR --> Success[Success] Provenance --> SuccessTesting
The fork has been tested with:
Verification
After merging, the next release will:
NPM_TOKENRelated