Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ jobs:
- run: pnpm run lint
- run: pnpm run test:coverage
- run: pnpm run build
- name: Verify Changelog on Version Change
if: github.event_name == 'pull_request'
run: |
# Fetch main branch to compare
git fetch origin main:main

# 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")

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

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

The version comparison logic has a potential issue. The command git show main:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version" is attempting to read from stdin (file descriptor 0), but the JSON string is already piped in. The correct approach is to directly parse stdin without using require('fs').readFileSync. Consider changing to: git show main:package.json | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf-8')).version" or using a simpler approach like git show main:package.json | node -pe "JSON.parse(require('fs').readFileSync(0)).version".

Suggested change
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 -pe "JSON.parse(require('fs').readFileSync(0)).version")

Copilot uses AI. Check for mistakes.

if [ "$CURRENT_VERSION" != "$OLD_VERSION" ]; then
echo "Version bumped from $OLD_VERSION to $CURRENT_VERSION"
if ! grep -q "\\[$CURRENT_VERSION\\]" CHANGELOG.md; then
echo "::error::Version bumped but CHANGELOG.md missing entry for version $CURRENT_VERSION"
exit 1
fi
echo "Changelog entry found for $CURRENT_VERSION"
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ jobs:

- run: pnpm run build

- name: Release
- name: Verify Changelog
run: |
VERSION=$(node -p "require('./package.json').version")
if ! grep -q "\\[$VERSION\\]" CHANGELOG.md; then
echo "::error::CHANGELOG.md missing entry for version $VERSION"
exit 1
fi

- name: Publish to GitHub Packages
run: |
pnpm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
pnpm publish --no-git-checks
Comment on lines +50 to +52

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

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

The pnpm publish command uses both an authentication token set via pnpm config set on line 51 and the NODE_AUTH_TOKEN environment variable on line 54. The NODE_AUTH_TOKEN environment variable is the standard way for pnpm to authenticate, but the config set command may conflict with it. Consider using only the environment variable approach for clarity. Additionally, when publishing to GitHub Packages, the registry URL should include the scope: //npm.pkg.github.com/@logkat/:_authToken to match the package name @logkat/broker-parser.

Suggested change
run: |
pnpm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
pnpm publish --no-git-checks
run: pnpm publish --no-git-checks --registry=https://npm.pkg.github.com

Copilot uses AI. Check for mistakes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/
run: npx semantic-release
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

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

The release workflow doesn't create a GitHub release or tag when publishing the package. Consider adding a step to create a GitHub release using the gh release create command or an action like actions/create-release to track releases properly and provide release notes to users.

Suggested change
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Git tag and GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists, skipping tag and release creation."
exit 0
fi
git tag "$TAG"
git push origin "$TAG"
gh release create "$TAG" --generate-notes

Copilot uses AI. Check for mistakes.
17 changes: 0 additions & 17 deletions .releaserc.json

This file was deleted.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^1.6.1",
"eslint": "^9.0.0",
"semantic-release": "^25.0.2",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vitest": "1.6.1"
Expand Down
Loading