Skip to content

fix(ci): use npm-publish environment in release job#168

Merged
iamfj merged 1 commit intonextfrom
fix/release-npm-publish-environment
Apr 23, 2026
Merged

fix(ci): use npm-publish environment in release job#168
iamfj merged 1 commit intonextfrom
fix/release-npm-publish-environment

Conversation

@iamfj
Copy link
Copy Markdown
Member

@iamfj iamfj commented Apr 23, 2026

Summary

  • bind release job to npm-publish environment so environment secret NPM_TOKEN resolves
  • add npm auth preflight (test -n NODE_AUTH_TOKEN + npm whoami) before semantic-release

Root cause

NPM_TOKEN was configured as an environment secret, but the job did not declare environment: npm-publish, so NODE_AUTH_TOKEN was empty in the release step.

Validation

  • inspected failed Actions log: NODE_AUTH_TOKEN empty in Run semantic-release
  • verified workflow now references the environment and fails early if auth is missing

Make env-scoped NPM_TOKEN available in release job.

Add explicit npm auth preflight to fail fast.
@iamfj iamfj force-pushed the fix/release-npm-publish-environment branch from ffaaedb to 0339929 Compare April 23, 2026 08:36
@iamfj iamfj merged commit 1c1a0df into next Apr 23, 2026
10 checks passed
@iamfj iamfj deleted the fix/release-npm-publish-environment branch April 23, 2026 08:37
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffaaedb8f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .releaserc.cjs Outdated
publishCmd:
'npx clean-publish --access public --tag $( [ "$GITHUB_REF_NAME" = "next" ] && echo next || echo latest ) -- --provenance',
},
{ publishCmd: "npx clean-publish --access public -- --provenance" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Set prerelease publish dist-tag explicitly

This config enables prereleases on the next branch (branches: ["main", { name: "next", prerelease: "next" }]), but the publish command does not pass any npm tag. npm publish uses the configured tag (default latest; confirmed via npm config get tag, and npm publish --help shows [--tag <tag>]), so next prereleases can be published as latest and become the default install for users. The publish step should set a channel-aware dist-tag (e.g., next for prereleases).

Useful? React with 👍 / 👎.

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