Repository navigation
chore(release): publish to npm with trusted publishing - #111
Merged
Merged
Conversation
Publish on release:published from release.yml instead of on every push to master, so the npm trusted publisher can be keyed on the filename and a person creating the GitHub release is what publishes; drop the NPM_TOKEN passed to JS-DevTools/npm-publish in favour of id-token: write (OIDC), run on Node 24 with npm@latest (trusted publishing needs npm >= 11.5.1), check out the release tag without persisted credentials. The auto-tag and create-release steps go away with the trigger; the tarball is attached to the release from a separate job with gh release upload instead of the archived upload-release-asset action. GitHub pre-releases go to the beta dist-tag. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Direct release-tag interpolation permits shell command execution with the upload job’s write-scoped token.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Migrates npm releases to release-triggered OIDC trusted publishing.
Changes:
- Replaces token-based publishing with Node 24 and OIDC authentication.
- Routes prereleases to
betaand stable releases tolatest. - Uploads release tarballs in a separate job using GitHub CLI.
| File | Description |
|---|---|
.github/workflows/release.yml |
Reworks publishing authentication, triggers, tooling, and asset uploads. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Refuse to publish when the release tag is not "v" + the package.json version, so a tag cut on the wrong commit cannot publish an older version under a newer tag. The tag now reaches the upload step through the RELEASE_TAG env variable instead of being interpolated into the shell line (GitHub Actions script-injection hardening). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lodash ^4.17.21 (4.17.21) -> ^4.18.1 (4.18.1) Fixes SNYK-JS-LODASH-15869619, SNYK-JS-LODASH-15053838 (Prototype Pollution) and SNYK-JS-LODASH-15869625 (Arbitrary Code Injection). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
netrajpatel
approved these changes
Oct 14, 2026
amit-kanswal-cs
approved these changes
Oct 14, 2026
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.


Problem
release.ymlondevelopmentstill publishes@contentstack/datasync-filesystem-sdkon every push tomasterwith a long-livedNPM_TOKENthroughJS-DevTools/npm-publish@v3, then tags, creates the GitHub release and attaches the tarball with archived actions (themastercopy is release-triggered, same token).The SE1 publishing policy requires OIDC trusted publishing instead: no token, a
release.ymlworkflow that runs when a release is published, Node 24.Fix
release.ymlis rewritten in place. What changes inside it:pushtomasterrelease: published— creating the GitHub release is what publishesNPM_TOKENviaJS-DevTools/npm-publish@v3id-token: write, no token, plainnpm publishnpm publish --access public; pre-releases go to thebetadist-tag, releases tolatestKlemensas/action-autotag,actions/create-release@v1(archived)actions/upload-release-asset@v1(archived) inside the publish jobupload-release-assetjob, runs after a successful publish:npm pack+gh release upload --clobberwith the job tokennpm install(+npm install npm-pack)npm cipersist-credentials: falsecheckout@v4,setup-node@v4@v7Verification
Node 22 and Node 24: install, build, unit tests and
npm packall pass.