chore(ci): split release.yml into build/publish/release-notes/notify jobs#58
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the release GitHub Actions workflow to isolate npm OIDC publishing into a dedicated job, reducing token blast radius and addressing the “OIDC publish fused with build steps” supply-chain finding.
Changes:
- Split the previous single release job into
build,publish,release-notes, andnotifyjobs. - Added artifact handoff from
build→publishso the OIDC-enabled publish job runs without checkout/install/build steps. - Reduced workflow-level permissions to
contents: read, with job-level overrides where needed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cedf07b to
a153c56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Restructures the release workflow into four jobs with an artifact handoff so the
id-token: writepermission is scoped to a job that does nothing butnpm publish. This resolves the supply-chain audit'soidc-publish-fusedfinding (OIDC publish should not share a job with arbitrary install/build/test code).Jobs
build(noid-token): checkout, setup pnpm + Node (no registry-url),pnpm install --frozen-lockfile, test, build, validatedist/index.js+dist/index.d.ts, then uploaddist/,package.json,README.md,LICENSEas thepackageartifact (1d retention, fail if empty).publish(needs: build,id-token: write+contents: read): setup Node withregistry-url, download thepackageartifact, runnpm publish --ignore-scriptswithNODE_AUTH_TOKEN=""to enable OIDC. No source checkout, no install — nothing else runs in this token's blast radius.release-notes(needs: publish,contents: write): checkout and runnpx changelogithub.notify(needs: [build, publish, release-notes],if: always()): existing Slack release-notification step, status derived fromcontains(needs.*.result, 'failure').Workflow-level permissions dropped to
contents: read. All preexisting action SHAs preserved;actions/upload-artifactandactions/download-artifactpinned to v4 SHAs.Test plan
publishjob successfully authenticates to npm via OIDC using only the downloaded artifact