Repository navigation
Conversation
|
|
📝 WalkthroughWalkthroughThe package metadata now directs npm publishing to the GitHub Packages registry. ChangesGitHub Packages publishing configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Around line 20-22: Align the package metadata and release workflow with the
intended registry: if publishing to GitHub Packages, scope the package name,
configure actions/setup-node with https://npm.pkg.github.com, grant packages:
write permission, and authenticate publishing with secrets.GITHUB_TOKEN via
NODE_AUTH_TOKEN; otherwise remove the publishConfig change and retain npmjs.org
publishing.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "publishConfig": { | ||
| "registry": "https://npm.pkg.github.com" | ||
| }, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- package.json ---'
cat -n package.json | sed -n '1,45p'
printf '%s\n' '--- release workflow candidates ---'
fd -i 'release.yml|release.yaml' .github . 2>/dev/null | head -20
printf '%s\n' '--- workflow excerpt ---'
if [ -f .github/workflows/release.yml ]; then
cat -n .github/workflows/release.yml | sed -n '1,130p'
elif [ -f .github/workflows/release.yaml ]; then
cat -n .github/workflows/release.yaml | sed -n '1,130p'
fiRepository: 4sllan/nuxt-umbu
Length of output: 5771
🌐 Web query:
GitHub Packages npm registry package names must be scoped owner packages write GITHUB_TOKEN actions/setup-node registry-url authentication publishConfig
💡 Result:
GitHub Packages only supports scoped npm packages [1][2][3]. Packages must have a name formatted as @SCOPE/PACKAGE-NAME, where the scope typically corresponds to the GitHub user or organization that owns the repository [1][2][3]. To publish to the GitHub Packages npm registry using GitHub Actions, you must configure your project to point to the registry and authenticate properly. 1. Package Configuration: You must ensure the package name in your package.json uses the required scope [1][2]. You can map this scope to the GitHub Packages registry using either a local.npmrc file or the publishConfig field in your package.json [1][3]. - Using publishConfig: "publishConfig": { "@SCOPE:registry": "https://npm.pkg.github.com/" } 2. GitHub Actions Authentication with GITHUB_TOKEN: To authenticate within a workflow, use the actions/setup-node action to configure the registry and authentication [4][5][6]. - Workflow Setup: You must grant the GITHUB_TOKEN the necessary permissions to publish [4][5]. permissions: packages: write contents: read - actions/setup-node configuration: Use the registry-url input to point to the GitHub Packages registry [4][5]. - uses: actions/setup-node@v7 with: registry-url: 'https://npm.pkg.github.com/' When running npm publish, you must provide the GITHUB_TOKEN via the NODE_AUTH_TOKEN environment variable [4][5][7]: - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} The setup-node action automatically generates an.npmrc file on the runner that references this NODE_AUTH_TOKEN for authentication [4][5][6].
Citations:
- 1: https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
- 2: https://docs.github.com/en/enterprise-cloud@latest/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
- 3: https://github.com/github/docs/blob/main/content/packages/working-with-a-github-packages-registry/working-with-the-npm-registry.md
- 4: https://docs.github.com/en/actions/tutorials/publish-packages/publish-nodejs-packages
- 5: https://docs.github.com/actions/publishing-packages/publishing-nodejs-packages
- 6: https://docs.github.com/actions/guides/building-and-testing-nodejs
- 7: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
import json
from pathlib import Path
package = json.loads(Path("package.json").read_text())
workflow = Path(".github/workflows/release.yml").read_text()
print("package.name:", package.get("name"))
print("package.publishConfig.registry:", package.get("publishConfig", {}).get("registry"))
for needle in [
"registry-url: 'https://registry.npmjs.org/'",
"NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}",
"packages: write",
"pnpm publish",
]:
print(f"{needle!r}:", needle in workflow)
PYRepository: 4sllan/nuxt-umbu
Length of output: 385
Align the package metadata and release workflow with GitHub Packages.
If GitHub Packages is the intended registry, scope the package name (for example, @4sllan/nuxt-umbu) because the GitHub npm registry requires scoped packages. Update actions/setup-node to https://npm.pkg.github.com, add packages: write, and use ${{ secrets.GITHUB_TOKEN }} as NODE_AUTH_TOKEN. The current npmjs configuration and NPM_TOKEN do not authenticate pnpm publish to GitHub Packages. If npmjs.org is intended, remove the publishConfig change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` around lines 20 - 22, Align the package metadata and release
workflow with the intended registry: if publishing to GitHub Packages, scope the
package name, configure actions/setup-node with https://npm.pkg.github.com,
grant packages: write permission, and authenticate publishing with
secrets.GITHUB_TOKEN via NODE_AUTH_TOKEN; otherwise remove the publishConfig
change and retain npmjs.org publishing.
Summary by CodeRabbit