Skip to content

Conversation

@Abhi347
Copy link
Contributor

@Abhi347 Abhi347 commented Jan 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 11, 2026 14:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix the release workflow by adding GitHub Release creation functionality and making a minor adjustment to file reading in the CI workflow.

Changes:

  • Removed manual pnpm authentication configuration in favor of using the NODE_AUTH_TOKEN environment variable
  • Added a new step to automatically create GitHub Releases with generated notes
  • Modified the file reading approach in the CI workflow's version comparison logic

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/release.yml Removed pnpm config authentication line and added automated GitHub Release creation step
.github/workflows/ci.yml Changed file reading method from using encoding parameter to using toString() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 49 to 53
- 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 }}
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.
Comment on lines +55 to +60
- 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
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.
# 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.
@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff            @@
##              main        #4   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          246       246           
  Branches        68        68           
=========================================
  Hits           246       246           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants