Add step to set package version in workflow#32
Conversation
Added step to set package version based on release tag or input. Signed-off-by: Lee Calcote <leecalcote@gmail.com>
There was a problem hiding this comment.
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.jsonversion fromrelease.tag_nameorworkflow_dispatchinput. - Modified the publish step environment configuration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: "Set Package Version" | ||
| uses: reedyuk/npm-version@1.1.1 | ||
| with: | ||
| version: ${{ github.event.release.tag_name }} || ${{ inputs.release_version }} | ||
|
|
There was a problem hiding this comment.
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.
| - name: "Set Package Version" | |
| uses: reedyuk/npm-version@1.1.1 | |
| with: | |
| version: ${{ github.event.release.tag_name }} || ${{ inputs.release_version }} |
| env: | ||
| NODE_AUTH_TOKEN: '' # Explicitly empty for install |
There was a problem hiding this comment.
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.
| env: | |
| NODE_AUTH_TOKEN: '' # Explicitly empty for install |
Added step to set package version based on release tag or input.
Notes for Reviewers
This PR fixes #
Signed commits