Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,31 @@ jobs:
- name: Pack
run: ./scripts/npm-pack.sh

- name: Determine dist-tag
id: dist_tag
run: |
Comment on lines +72 to +74
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

id: dist-tag is referenced as ${{ steps.dist-tag.outputs.tag }}. In GitHub Actions expressions, step IDs containing - generally can’t be accessed via dot notation (the - is treated as an operator). Rename the step id to something like dist_tag (or distTag) or use bracket syntax: steps['dist-tag'].outputs.tag.

Copilot uses AI. Check for mistakes.
TAG=$(node -p "
const v = require('./package.json').version;
const pre = v.split('-')[1];
!pre ? 'latest' : (pre.split('.')[0].replace(/[0-9]+$/, '') || 'next')
")
if [[ -z "$TAG" ]]; then
echo "::error::Failed to determine dist-tag"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

echo "tag=$TAG" >> "$GITHUB_OUTPUT" can behave unexpectedly if the value ever starts with - or contains characters that echo interprets; using printf 'tag=%s\n' "$TAG" >> "$GITHUB_OUTPUT" is more robust for writing outputs in bash.

Suggested change
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
printf 'tag=%s\n' "$TAG" >> "$GITHUB_OUTPUT"

Copilot uses AI. Check for mistakes.
echo "Resolved dist-tag: $TAG"

- name: Publish
run: |
TAG="${{ steps.dist_tag.outputs.tag }}"
if [[ -z "$TAG" ]]; then
echo "::error::dist-tag is empty, aborting publish"
exit 1
fi
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
echo "=== DRY RUN ==="
npm publish --provenance --access public --dry-run ./dist/rclnodejs-*.tgz
npm publish --provenance --access public --tag "$TAG" --dry-run ./dist/rclnodejs-*.tgz
else
npm publish --provenance --access public ./dist/rclnodejs-*.tgz
npm publish --provenance --access public --tag "$TAG" ./dist/rclnodejs-*.tgz
fi
Loading