Skip to content

[npm] Add automated NPM publish path#893

Open
gregnazario wants to merge 1 commit into
mainfrom
github-action-release
Open

[npm] Add automated NPM publish path#893
gregnazario wants to merge 1 commit into
mainfrom
github-action-release

Conversation

@gregnazario

Copy link
Copy Markdown
Collaborator

To remove usage of tokens, it runs everything through github

Description

Test Plan

Related Links

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

To remove usage of tokens, it runs everything through github
@gregnazario gregnazario requested a review from a team as a code owner May 12, 2026 20:33
@gregnazario gregnazario requested review from Copilot and removed request for a team May 12, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to publish the SDK package to npm on GitHub Release publish events, aiming to use GitHub OIDC trusted publishing (no long-lived npm tokens) and add basic safety checks around version/tag correctness.

Changes:

  • Added a release.published workflow that validates the release tag format and enforces package.json version === tag.
  • Builds the package with pnpm and publishes to npm with provenance enabled.
  • Adds an npm upgrade step intended to work around an npm OIDC trusted publishing issue for scoped packages.

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

Comment on lines +21 to +22
if ! echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
echo "::error::Release tag '$TAG' does not match pattern vMAJOR.MINOR.PATCH[-prerelease]"
# npm (https://github.com/npm/cli/issues/8678). Without this, publishing a
# scoped package via trusted publishing fails with E404.
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest
run: npm install -g npm@latest

- name: Publish to npm with provenance
run: npm publish --provenance --access public
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