Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

# Get versions
CURRENT_VERSION=$(node -p "require('./package.json').version")
OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version")
OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0).toString()).version")
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The change from readFileSync(0, 'utf-8') to readFileSync(0).toString() is functionally equivalent but the original approach with the encoding parameter is more direct and readable. However, this change doesn't appear to provide any functional improvement or fix an actual issue. The original code was already correct as readFileSync accepts an encoding parameter as the second argument when reading from file descriptor 0 (stdin).

Suggested change
OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0).toString()).version")
OLD_VERSION=$(git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version")

Copilot uses AI. Check for mistakes.

if [ "$CURRENT_VERSION" != "$OLD_VERSION" ]; then
echo "Version bumped from $OLD_VERSION to $CURRENT_VERSION"
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ jobs:

- name: Publish to GitHub Packages
run: |
pnpm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines 49 to 53
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The removal of the pnpm config line may cause authentication issues when publishing to GitHub Packages. The NODE_AUTH_TOKEN environment variable alone is not sufficient for pnpm to authenticate with GitHub Packages. You need to either:

  1. Keep the pnpm config set command to configure the auth token, or
  2. Add a .npmrc file to the repository with the registry configuration, or
  3. Configure the registry-url parameter in the actions/setup-node step to automatically set up authentication

Without proper authentication configuration, the pnpm publish command will likely fail when attempting to publish to https://npm.pkg.github.com/.

Copilot uses AI. Check for mistakes.

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
gh release create v$VERSION --generate-notes
Comment on lines +55 to +60
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The gh CLI tool is being used but it's not guaranteed to be available in the GitHub Actions runner. While gh is pre-installed on GitHub-hosted runners, the workflow should explicitly verify this or use the official actions/create-release action or gh-actions/create-release for more reliability and clarity. Additionally, consider adding error handling to check if the release already exists before attempting to create it.

Suggested change
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
gh release create v$VERSION --generate-notes
- name: Get package version
id: get_version
run: |
echo "version=$(node -p \"require('./package.json').version\")" >> "$GITHUB_OUTPUT"
- name: Check if GitHub Release exists
id: check_release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tag = 'v${{ steps.get_version.outputs.version }}';
try {
await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag,
});
core.setOutput('exists', 'true');
} catch (error) {
if (error.status === 404) {
core.setOutput('exists', 'false');
} else {
throw error;
}
}
- name: Create GitHub Release
if: steps.check_release.outputs.exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
generate_release_notes: true

Copilot uses AI. Check for mistakes.