Repository navigation
fix: Fix release workflow #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
|
||||||||||||||||||||||||||||||||||||||||
| 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
AI
Jan 11, 2026
There was a problem hiding this comment.
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.
| 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 |
This file was deleted.
There was a problem hiding this comment.
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 usingrequire('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 likegit show main:package.json | node -pe "JSON.parse(require('fs').readFileSync(0)).version".