Chore: Migrate npm publish workflow to OIDC#120
Open
adamantmm wants to merge 2 commits into
Open
Conversation
Remove NPM_TOKEN from the release publish job now that npm Trusted Publisher is configured. Align with adamant-api: Node 24, npm latest, provenance in publishConfig, and release tag version check. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the npm publishing workflow from using a repository-stored NPM_TOKEN to npm Trusted Publishing via GitHub Actions OIDC, aligning the repo’s release process with sibling projects and enabling provenance.
Changes:
- Switch
.github/workflows/publish-npm.ymlto OIDC-based publishing (noNODE_AUTH_TOKEN) and add a manualworkflow_dispatchtrigger. - Upgrade the publishing workflow to Node.js 24, update npm during the job, and add a release-tag ↔
package.jsonversion guard for release events. - Enable npm provenance by default via
publishConfig.provenance: trueinpackage.json.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/publish-npm.yml |
Updates the publish workflow to use OIDC Trusted Publishing, adds manual trigger, and introduces release/version guards. |
package.json |
Enables provenance on publish via publishConfig.provenance. |
Comments suppressed due to low confidence (1)
.github/workflows/publish-npm.yml:25
workflow_dispatchcan publish from any user-selected ref (including feature branches), which makes it easy to accidentally publish an unintended build. If manual publishing is only meant for verification onmaster(or tags), add a job-level guard so the job only runs for releases, or for dispatches from allowed refs.
jobs:
publish:
runs-on: ubuntu-latest
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…name checkout step
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.
Description
Switch npm publishing in
.github/workflows/publish-npm.ymlfromNPM_TOKENto Trusted Publishing (OIDC).Trusted Publisher is already configured on npmjs.com for
Adamant-im/adamant-tradebotand workflow filepublish-npm.yml. This aligns the tradebot withadamant-apiandadamant-consolepublish workflows.Related issue
Closes #119
Changes
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}from the publish stepnpm install -g npm@latestfor OIDC-compatible npm CLIworkflow_dispatchtrigger for manual publish verificationpackage.jsonversion guard on release eventspublishConfig.provenance: trueinpackage.jsonBreaking changes
No runtime or user-facing breaking changes. CI-only change.
How to test
dev, thenmasterworkflow_dispatchonmaster(dry run not available — use a patch release or test on next tag)v9.0.1or later), confirm:NPM_TOKENNPM_TOKENsecret after successful OIDC publishNotes for reviewers
id-token: writewas already present; this PR removes the token fallback pathChecklist