Skip to content

chore(NODE-7563): migrate 6.x release workflows to npm trusted publishers#4943

Closed
tadjik1 wants to merge 3 commits into
6.xfrom
chore/NODE-7562-npm-trusted-publishers-6x
Closed

chore(NODE-7563): migrate 6.x release workflows to npm trusted publishers#4943
tadjik1 wants to merge 3 commits into
6.xfrom
chore/NODE-7562-npm-trusted-publishers-6x

Conversation

@tadjik1
Copy link
Copy Markdown
Member

@tadjik1 tadjik1 commented May 18, 2026

Description

Summary of Changes

Migrates release-6.x.yml, release-alpha.yml, and release-nightly.yml on the 6.x branch to npm Trusted Publishing by dispatching to the centralized npm-publish.yml workflow (lives on main, introduced in #4930). Adds dispatch-and-wait.mjs helper script — required because GitHub Actions loads workflow files from the triggering branch, but the script defaults to loading npm-publish.yml from main. Also removes the dormant release-6.8.yml (6.8 branch is EOL; last release was 6.8.2 in Sep 2024).

Notes for Reviewers

The 6.x branch uses drivers-github-tools@v2 (not v3 like main) — this is pre-existing and not changed by this PR.

Main PR: #4941 — 5.x PR: #4942

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

…hers

Replace NPM_TOKEN with OIDC dispatch to npm-publish.yml in
release-6.x.yml, release-alpha.yml, and release-nightly.yml;
add dispatch-and-wait.mjs; remove dormant release-6.8.yml.
Comment on lines +33 to +37
run: |
node ./.github/scripts/dispatch-and-wait.mjs npm-publish.yml \
tag=alpha \
version="${{ inputs.alphaVersion }}" \
ref="${{ github.sha }}"
Copy link
Copy Markdown

@semgrep-code-mongodb semgrep-code-mongodb Bot May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

🎈 Fixed in commit 15ab807 🎈

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth to mention - this was pre-existing pattern.

Move alphaVersion input to an env var so bash does not perform
command substitution on user-controlled input (semgrep finding).
@tadjik1 tadjik1 marked this pull request as ready for review May 18, 2026 11:06
@tadjik1 tadjik1 requested a review from a team as a code owner May 18, 2026 11:06
@tadjik1 tadjik1 changed the title chore(NODE-7562): migrate 6.x release workflows to npm trusted publishers chore(NODE-7563): migrate 6.x release workflows to npm trusted publishers May 18, 2026
@tadjik1
Copy link
Copy Markdown
Member Author

tadjik1 commented May 18, 2026

closed as we are not going to backport these changes yet

@tadjik1 tadjik1 closed this May 18, 2026
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.

1 participant