Skip to content

fix: restore NPM_TOKEN auth and add --access public for scoped package publish#7475

Merged
DennisOSRM merged 2 commits intomasterfrom
fix/release-npm-ignore-scripts
Apr 12, 2026
Merged

fix: restore NPM_TOKEN auth and add --access public for scoped package publish#7475
DennisOSRM merged 2 commits intomasterfrom
fix/release-npm-ignore-scripts

Conversation

@DennisOSRM
Copy link
Copy Markdown
Collaborator

Fixes two issues blocking npm publish of @project-osrm/osrm:

  1. Auth failure (404): setup-node configures .npmrc to use NODE_AUTH_TOKEN, but that env var was never set at publish time. npm OIDC Trusted Publishers requires explicit configuration on the npm package settings page — without it the auth token is empty and npm returns 404. Restores NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}.

  2. Scoped package access: Scoped packages (@project-osrm/osrm) default to private on npm. --access public is required for public publishing.

Copilot AI review requested due to automatic review settings April 12, 2026 18:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the monthly release workflow around npm publishing, ostensibly to fix issues blocking publication of @project-osrm/osrm.

Changes:

  • Switch dependency installation from npm install to npm ci --ignore-scripts (skipping lifecycle scripts).
  • Leaves the npm publish invocation unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Install dependencies (skip native build scripts)
run: npm ci --ignore-scripts

- name: Publish to npm
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

The publish step doesn't provide NODE_AUTH_TOKEN, so actions/setup-node won't be able to authenticate to npm (it writes an .npmrc that expects this env var). Add env: { NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} } (or equivalent) to the publish step (or job) so npm publish has a token at runtime.

Suggested change
- name: Publish to npm
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Copilot uses AI. Check for mistakes.
Comment on lines 222 to 223
- name: Publish to npm
run: npm publish
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

PR title/description says --access public is required for publishing the scoped package, but the workflow still runs plain npm publish. Either add --access public here, or (if publishConfig.access in package.json is intended to cover this) update the PR description/title to match what the change actually does.

Copilot uses AI. Check for mistakes.
GITHUB_TOKEN pushes do not trigger new workflow runs (GitHub prevents
recursive loop triggers). This means the tag push from the release
workflow never triggered osrm-backend.yml, so no binaries were built
or uploaded to the release assets.

Changes:
- Add workflow_dispatch trigger to osrm-backend.yml
- Add 'actions: write' permission to release workflow
- After pushing the tag, explicitly dispatch osrm-backend.yml on the
  tag ref; CI runs with GITHUB_REF=refs/tags/v* so PUBLISH=On and
  prebuilt binaries are built and uploaded
- Restore NODE_AUTH_TOKEN and add --access public for scoped npm package

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DennisOSRM DennisOSRM force-pushed the fix/release-npm-ignore-scripts branch from 569369c to 7fcbf54 Compare April 12, 2026 18:14
publishConfig.access=public is already set in package.json, so --access
public is redundant. OIDC via setup-node handles authentication when
id-token: write is set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DennisOSRM DennisOSRM merged commit d3e0a35 into master Apr 12, 2026
1 check passed
@DennisOSRM DennisOSRM deleted the fix/release-npm-ignore-scripts branch April 12, 2026 18:18
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