Repository navigation
chore(ci): gate npm publishing behind npm-publish environment and admin check - #7675
Conversation
β¦in check Co-authored-by: Cursor <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review info
π Walkthrough
Merge Risk: βͺ Minimal Β· up to
|
There was a problem hiding this comment.
π΅ Needs a closer look
The security guarantees depend on main-only environment restrictions and npm trusted-publisher bindings that require human verification.
No open issues π
What changed in this PR
Tightens CI controls for npm publishing while keeping canary releases automatic on pushes to main.
Changes:
- Assigns both release jobs to the
npm-publishenvironment. - Requires the triggering user to have repository admin permission before stable-release checkout.
| File | Description |
|---|---|
.github/βworkflows/βrelease.yml |
Adds publishing environment bindings and a stable-release admin check. |
Review effort: Balanced
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
## π― Changes The merge queue never merges anything: none of the workflows that produce required status checks trigger on `merge_group`, and most `main.yml` jobs were gated to `pull_request`. Only the Vercel checks report on the queue commit, so entries sit until they're kicked out with `checks_timed_out` β this happened twice each to trpc#7672 and trpc#7675. - `main.yml`: trigger on `merge_group`; build, typecheck, typecheck-www and all E2E jobs now run for `pull_request` or `merge_group`. `Release using pkg.pr.new` is skipped in the queue. - `lint.yml`: trigger on `merge_group`; lint/fix steps still run, but instead of the autofix.ci commit (which can't push to a queue branch) the job fails if `git diff` is non-empty. - `semantic-pr.yml`: trigger on `merge_group` with the job skipped there (the title is already validated on the PR), so the required `test title` check reports as passing. Once merged, trpc#7672 and trpc#7675 can be re-queued. ## β Checklist - [x] I have followed the steps listed in the [Contributing guide](https://github.com/trpc/trpc/blob/main/CONTRIBUTING.md). - [ ] If necessary, I have added documentation related to the changes made. - [ ] I have added or updated the tests related to the changes made. Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <[email protected]>
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Closes #
π― Changes
Restricts who can publish to npm from CI:
npm-publishGitHub environment, which only allows deployments frommain. The npm trusted publisher config for each package is being re-bound to this environment, so npm only accepts OIDC tokens from jobs running innpm-publishonmain. Previously any branch runningrelease.ymlcould get a valid publish token.publishjob first checks thatgithub.triggering_actorhasadminpermission on the repo (currently thetrpc-godmodemembers) and fails before checkout otherwise.mainstays automatic.Follow-ups outside this PR:
--env npm-publishon all published packages.ACCESS_TOKENfrom a repository secret to annpm-publishenvironment secret, so workflows on other branches can't read it.Note: publishing to
@trpc/*is still blocked independently by a Cloudflare rule on npm's side (PUT /@trpc/*returns a "you have been blocked" page). This PR doesn't fix that.β Checklist
Summary by CodeRabbit
npm-publishenvironment.