-
Notifications
You must be signed in to change notification settings - Fork 3
chore: migrate release workflows to npm Trusted Publishers with unified workflow #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate release workflows to npm Trusted Publishers with unified workflow #52
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe PR consolidates separate beta and stable release workflows into a single configurable workflow by removing the dedicated release-beta.yml and extending release.yml with conditional logic. Additionally, it updates publishing documentation to replace NPM_TOKEN-based authentication with npm Trusted Publisher using GitHub OIDC, and clarifies beta/stable release procedures. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks✅ Passed checks (4 passed)
Comment |
|
@copilot OK but it turns out npmjs only allows trusted publishing for one workflow so we need to unify release.yml and release-beta.yml into one top-level workflow. That means there should be a beta boolean parameter which decides which sub-workflow to use. All existing behaviour should be completely preserved; the only difference should be that there's one entrypoint instead of two. |
Done. Unified both release workflows into a single |
|
@copilot It failed the linter |
ddcb578 to
8db6376
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
8db6376 to
a88bb6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/release-beta.yml.github/workflows/release.ymlPUBLISHING.md
💤 Files with no reviewable changes (1)
- .github/workflows/release-beta.yml
🧰 Additional context used
📓 Path-based instructions (1)
!(types)/**/*.{js,ts,tsx,json,md}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run formatwith Prettier before committing to ensure consistent code formatting
Files:
.github/workflows/release.ymlPUBLISHING.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 37
File: lexicons/org/hypercerts/funding/receipt.json:1-71
Timestamp: 2025-12-15T15:33:27.052Z
Learning: For the hypercerts-org/hypercerts-lexicon repository, do not comment on Prettier formatting issues in code reviews because they are already reported by the lint workflow, and duplicating the report adds noise to the review.
📚 Learning: 2025-12-15T16:39:23.964Z
Learnt from: aspiers
Repo: hypercerts-org/hypercerts-lexicon PR: 39
File: README.md:17-17
Timestamp: 2025-12-15T16:39:23.964Z
Learning: In the hypercerts-lexicon repository, standardize on the hyphenless spelling 'onchain' across Markdown documentation (e.g., README.md and other md files) to match the industry standard. Update any occurrences of 'on-chain' to 'onchain' and ensure consistency throughout all documentation.
Applied to files:
PUBLISHING.md
🔇 Additional comments (13)
PUBLISHING.md (1)
107-108: LGTM!The RELEASE_PAT requirement for beta releases is correctly documented and matches the workflow implementation.
.github/workflows/release.yml (12)
20-22: LGTM!The comment clearly explains the
id-token: writepermission requirement for npm Trusted Publishers and provides a helpful documentation link.
25-34: LGTM!Good defensive check that fails fast with a clear error message if the required
RELEASE_PATsecret is missing for beta releases.
39-40: LGTM!The conditional token selection correctly uses
RELEASE_PATfor beta releases (to bypass branch protection when pushing) andGITHUB_TOKENfor stable releases (which only create PRs).
42-52: LGTM!The branch check correctly enforces that beta releases must run on the
mainbranch, with a clear explanation of why this check is necessary for manual workflow triggers.
58-59: LGTM!The
registry-urlconfiguration is correctly set for npm Trusted Publishers to enable OIDC authentication.
64-74: LGTM!The prerelease mode entry logic is correct and idempotent—it only enters prerelease mode if not already in it. The commit will be pushed later along with version changes, which is efficient.
76-82: LGTM!The version packages step correctly runs only for beta releases and provides the necessary
GITHUB_TOKENfor changesets.
83-84: LGTM!Clear explanation that no
.npmrccreation is needed because npm Trusted Publishers uses OIDC tokens automatically.
86-98: LGTM!The stable release path correctly uses
changesets/actionwith proper conditionals, provenance settings, and a pinned action version.
100-108: LGTM!The beta publish step correctly uses
npm run release(consistent with the stable path) and enables provenance. The comment helpfully explains the validation behavior.
109-117: LGTM!The commit and push logic correctly handles beta version changes, only committing when there are staged changes, and uses the PAT configured in the checkout step to bypass branch protection.
119-122: LGTM!The logging step appropriately runs only for stable releases when packages were actually published, providing useful workflow output.
Because the Trusted Publishers mechanism only supports one publishing workflow per repo, this requires unifying the two release workflows into a single one, with a beta parameter to distinguish between them. Co-authored-by: [email protected]
a88bb6b to
164bc4f
Compare
Plan: Migrate Release Workflows to npm Trusted Publishers
Summary
Successfully migrated both release workflows to use npm Trusted Publishers and unified them into a single workflow with a boolean parameter. Fixed prettier formatting issues with the workflow file (changed single quotes to double quotes in description field).
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.