chore: keep generated templates when the starter repo is unreachable - #1447
Conversation
commit: |
|
Warning Review limit reached
Next review available in: 11 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe release workflow now exposes Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 @.github/workflows/release.yml:
- Around line 79-80: Update the release workflow so the install step runs pnpm
install --frozen-lockfile --ignore-scripts without GITHUB_TOKEN, then invoke
generate-data.ts in a separate token-scoped step, and run pnpm build in a step
without the token. Remove or bypass the current postinstall flow that combines
generation and building during dependency installation, while preserving the
required command order.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9359bc10-3c1b-4921-b73d-c7636d436790
📒 Files selected for processing (2)
.github/workflows/release.ymlscripts/generate-data.ts
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- workflow context ---'
sed -n '1,130p' .github/workflows/release.yml
printf '%s\n' '--- tracked package manifests ---'
git ls-files '*package.json' '*pnpm-lock.yaml' | sed -n '1,120p'
printf '%s\n' '--- lifecycle and token references ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
'GITHUB_TOKEN|generate-data|postinstall|preinstall|prepare' .Repository: nuxt/cli
Length of output: 9652
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- root package manifest ---'
cat -n package.json | sed -n '1,110p'
printf '%s\n' '--- generator and token consumer ---'
fd -t f -a 'generate-data.ts|starter-templates.ts|fetch.ts' .
for f in $(fd -t f -a 'generate-data.ts|starter-templates.ts|fetch.ts' .); do
printf '\n--- %s ---\n' "$f"
wc -l "$f"
cat -n "$f" | sed -n '1,240p'
done
printf '%s\n' '--- package-manager configuration and versions ---'
fd -t f -a -i 'pnpm*|*.npmrc|package.json' . | sed -n '1,160p'
rg -n --hidden --glob '!node_modules' \
'packageManager|engine-strict|ignore-scripts|onlyBuiltDependencies|neverBuiltDependencies|approve-builds|supportedArchitectures' \
package.json pnpm-workspace.yaml .npmrc .github scripts packages 2>/dev/null || trueRepository: nuxt/cli
Length of output: 29321
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import json
import re
workflow = Path(".github/workflows/release.yml").read_text()
manifest = json.loads(Path("package.json").read_text())
generator = Path("scripts/generate-data.ts").read_text()
templates = Path("packages/nuxt-cli/src/utils/starter-templates.ts").read_text()
assert "permissions: {}" in workflow
install = re.search(
r"- name: 📦 Install dependencies(?P<body>.*?)(?=\n\s{6}- id: pack\b)",
workflow,
re.S,
)
assert install, "pack install step not found"
install_body = install.group("body")
assert "run: pnpm install --frozen-lockfile" in install_body
assert "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" in install_body
assert "--ignore-scripts" not in install_body
postinstall = manifest["scripts"]["postinstall"]
assert "scripts/generate-data.ts" in postinstall
assert "pnpm build" in postinstall
assert "fetchTemplates" in generator
assert "process.env.GITHUB_TOKEN" in templates
assert "authorization: `token ${process.env.GITHUB_TOKEN}`" in templates
safe_sequence = [
"pnpm install --frozen-lockfile --ignore-scripts",
"node --experimental-strip-types ./scripts/generate-data.ts",
"pnpm build",
]
assert all(command in postinstall or command in safe_sequence for command in safe_sequence)
print("pack install passes GITHUB_TOKEN to pnpm without --ignore-scripts")
print("root postinstall runs generator and build")
print("generator reaches token-backed GitHub API requests")
print("safe split requires install --ignore-scripts, generator, then build")
PYRepository: nuxt/cli
Length of output: 373
Do not expose GITHUB_TOKEN during dependency installation.
Run pnpm install --frozen-lockfile --ignore-scripts, then run generate-data.ts with the token in a separate step, followed by pnpm build without the token. The current postinstall runs both commands. The install-scoped token is inherited by allowed dependency lifecycle scripts. permissions: {} does not prevent token exfiltration.
🤖 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 @.github/workflows/release.yml around lines 79 - 80, Update the release
workflow so the install step runs pnpm install --frozen-lockfile
--ignore-scripts without GITHUB_TOKEN, then invoke generate-data.ts in a
separate token-scoped step, and run pnpm build in a step without the token.
Remove or bypass the current postinstall flow that combines generation and
building during dependency installation, while preserving the required command
order.
b86fc51 to
74f1c75
Compare
74f1c75 to
bbe5bb2
Compare
🔗 Linked issue
📚 Description
small chore - avoids failures when running
pnpm installlocally and hitting a github rate limit