Skip to content

Create npm-publish-github-packages.yml #412

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

piglee05022
Copy link

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 17:00
Copy link

@Copilot 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 adds a new GitHub Actions workflow to run tests and publish the npm package to GitHub Packages whenever a release is created.

  • Introduces a build job to install dependencies and run tests.
  • Adds a publish-gpr job to authenticate and publish the package using the repository’s GITHUB_TOKEN.
Comments suppressed due to low confidence (2)

.github/workflows/npm-publish-github-packages.yml:4

  • [nitpick] The workflow name is very generic. Consider using a more descriptive title like "Publish to GitHub Packages" to clarify its purpose in the Actions UI.
name: Node.js Package

.github/workflows/npm-publish-github-packages.yml:21

  • [nitpick] The job key publish-gpr is abbreviated and may be unclear. Renaming it to publish-github-packages would improve readability and self-documentation.
  publish-gpr:

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

Consider adding an actions/cache@v3 step to cache ~/.npm between runs, which can significantly reduce install time for repeated workflows.

Suggested change
registry-url: https://npm.pkg.github.com/
registry-url: https://npm.pkg.github.com/
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

Copilot uses AI. Check for mistakes.

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.

1 participant