Skip to content

chore(ci): release in the npm-release environment without stored tokens (release-v13) - #3449

Merged
MartinCupela merged 2 commits into
release-v13from
chore/release-environment-v13
Nov 14, 2026
Merged

MartinCupela merged 2 commits into
release-v13from
chore/release-environment-v13

Conversation

@MartinCupela

@MartinCupela MartinCupela commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

npm trusted publishing checks the repository and the workflow file name, not the branch. Today anyone with write access could push a branch with their own release.yml, start it, and publish to npm.

This PR runs the release job in the npm-release environment. The environment already exists and is set up as follows:

  • Branches: master and release-v* only.
  • Required reviewers: oliverlaz, NikolaGoranNaumovski, MartinCupela, with self-review blocked.

What changes for releases

  • Every release run waits for one of the reviewers to approve it. Whoever starts the run can't approve it themselves.
  • Dry runs also go through the environment. They have to start from master or release-v* and need approval too. A run from any other branch fails before it starts.

After merge

On npmjs.com, set Settings → Trusted Publisher → Environment to npm-release for stream-chat-react. From then on npm rejects OIDC tokens from runs outside the environment. Do this only after the same change is merged on every releasing branch (master, release-v9 to release-v14), or releases from a branch without it fail.

Stored tokens

This PR also removes the stored tokens from the release job, the same change as #3437 on master and #3438 on release-v14:

  • No NPM_TOKEN. The token has expired, and @semantic-release/npm 13 publishes through OIDC first.
  • GITHUB_TOKEN is the workflow's built-in token instead of the shared DOCUSAURUS_GH_TOKEN. The workflow already grants contents, issues and pull-requests write.

The release job runs in the npm-release environment, which only master
and release-v* may use and which needs a reviewer's approval. Once the
npm trusted publisher requires this environment, a release.yml run from
any other branch can no longer publish.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c091178d-89f5-4831-b5ef-7a14caf12e21

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Releases publish to npm through OIDC trusted publishing, so the release
job no longer passes NPM_TOKEN. Semantic-release pushes the changelog
commit, creates the GitHub release and comments on released issues and
PRs with the workflow's built-in GITHUB_TOKEN instead of the shared
DOCUSAURUS_GH_TOKEN org secret.
@MartinCupela MartinCupela changed the title chore(ci): run releases in the npm-release environment (release-v13) chore(ci): release in the npm-release environment without stored tokens (release-v13) Nov 13, 2026
@MartinCupela
MartinCupela merged commit e2d2d54 into release-v13 Nov 14, 2026
5 of 6 checks passed
@MartinCupela
MartinCupela deleted the chore/release-environment-v13 branch November 14, 2026 00:33
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.

2 participants