Skip to content

Add step to set package version in workflow#32

Merged
leecalcote merged 1 commit intomasterfrom
leecalcote-patch-5
Mar 5, 2026
Merged

Add step to set package version in workflow#32
leecalcote merged 1 commit intomasterfrom
leecalcote-patch-5

Conversation

@leecalcote
Copy link
Member

Added step to set package version based on release tag or input.

Notes for Reviewers

This PR fixes #

Signed commits

  • Yes, I signed my commits.

Added step to set package version based on release tag or input.

Signed-off-by: Lee Calcote <leecalcote@gmail.com>
Copilot AI review requested due to automatic review settings March 5, 2026 04:33
@leecalcote leecalcote merged commit 25d4970 into master Mar 5, 2026
3 checks passed
@leecalcote leecalcote deleted the leecalcote-patch-5 branch March 5, 2026 04:33
Copy link
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

This PR updates the NPM publish workflow to set the package version based on either the GitHub release tag or a manually provided workflow input, aligning the published artifact version with the release process.

Changes:

  • Added a workflow step intended to set package.json version from release.tag_name or workflow_dispatch input.
  • Modified the publish step environment configuration.

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

Comment on lines +38 to +42
- name: "Set Package Version"
uses: reedyuk/npm-version@1.1.1
with:
version: ${{ github.event.release.tag_name }} || ${{ inputs.release_version }}

Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

version: is built by concatenating two separate expressions with a literal || in between, which will yield strings like v1.2.3 || and fail semver parsing. Use a single GitHub Actions expression for fallback selection (e.g., github.event.release.tag_name || inputs.release_version) or reuse the existing RELEASE_VERSION logic from the later step. Also note this step appears redundant with the existing "Update Release Version" step that already runs npm version, so you likely want only one of them to avoid double-bumping the version/lockfile.

Suggested change
- name: "Set Package Version"
uses: reedyuk/npm-version@1.1.1
with:
version: ${{ github.event.release.tag_name }} || ${{ inputs.release_version }}

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +79
env:
NODE_AUTH_TOKEN: '' # Explicitly empty for install
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

This step defines env: twice; YAML will take the latter, so NODE_AUTH_TOKEN becomes the empty string and npm publish will fail authentication. Remove the second env: block (or merge them) so the publish step uses secrets.NPM_TOKEN.

Suggested change
env:
NODE_AUTH_TOKEN: '' # Explicitly empty for install

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants