ci: Use npm registry HTTP API for dist-tag promotion (no-changelog)#28898
Queued
ci: Use npm registry HTTP API for dist-tag promotion (no-changelog)#28898
Conversation
…rkflow (no-changelog) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces npm CLI dist-tag calls (which suffer from auth resolution issues for scoped packages per npm/cli#8547) with direct fetch calls to the npm registry API, passing NPM_TOKEN explicitly via env var. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant GHA as GitHub Actions Runner
participant Script as Promotion Script
participant Pnpm as Monorepo Utils
participant Registry as npm Registry API
Note over GHA,Registry: NEW: Direct HTTP Registry Interaction Flow
GHA->>Script: Execute (node set-latest-for-monorepo-packages.mjs)
Note right of GHA: Injected: NPM_TOKEN env var
Script->>Pnpm: getMonorepoProjects()
Pnpm-->>Script: List of package names + versions
loop For each public package
Script->>Script: URL-encode package name (e.g. @n8n/core -> @n8n%2fcore)
Script->>Registry: CHANGED: PUT /-/package/:name/dist-tags/latest
Note right of Script: Headers: Authorization Bearer [TOKEN]<br/>Body: "version.string"
alt Success (HTTP 2xx)
Registry-->>Script: 200 OK
Script->>GHA: Log success
else HTTP Error (e.g. 403, 404)
Registry-->>Script: Error Status + Body
Script->>GHA: NEW: Log status code and response body
Script->>Script: Record failure
else Network Error
Script->>GHA: NEW: Catch fetch error and log
Script->>Script: Record failure
end
end
alt Any packages failed
Script-->>GHA: NEW: Throw Error (Process Exit 1)
else All packages succeeded
Script-->>GHA: Success (Process Exit 0)
end
shortstacked
approved these changes
Apr 22, 2026
Any commits made after this event will not be merged.
Any commits made after this event will not be merged.
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.
Summary
Follow-up to #28889
The
release-set-stable-npm-packages-to-latestworkflow was failing with 403 errors when settinglatestdist-tags for scoped@n8n/*packages.Fix: replace the
npm dist-tag addCLI calls with directfetchrequests to the npm registry HTTP API (PUT /-/package/:name/dist-tags/:tag), passingNPM_TOKENexplicitly via env var. This bypasses the CLI auth resolution chain entirely and works identically for both scoped and unscoped packages.Additional improvements:
fetch) are caught and reported per-package rather than crashing the whole runRelated Linear tickets, Github issues, and Community forum posts
No ticket — identified from CI failure logs.
Review / Merge checklist
🤖 PR Summary generated by AI