Test raindex npm release from PR#2585
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR extends the npm-package-release workflow to support pull request events with proper gating and ref alignment, and introduces a new bootstrap publishing workflow that manually publishes the raindex package to npm with version verification and conditional publishing logic. ChangesNPM Package Release PR Support
Bootstrap Raindex NPM Publish Workflow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 @.github/workflows/npm-package-release.yml:
- Line 217: The git push line interpolates github.head_ref directly into the
shell which risks template injection; fix it by assigning the branch expression
to a workflow environment variable (e.g., GIT_REF = ${{ github.head_ref ||
github.ref_name }}) and then use a quoted env variable in the push command (git
push origin HEAD:"$GIT_REF") so the shell receives a single safely-escaped
argument; update the workflow step that contains git push origin HEAD:${{
github.head_ref || github.ref_name }} to use the GIT_REF env var and ensure the
push command uses double quotes around $GIT_REF.
🪄 Autofix (Beta)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4b6e2525-843b-40fa-bbb1-5de21c5bb39f
📒 Files selected for processing (2)
.github/workflows/npm-package-release.yml.github/workflows/npm-raindex-bootstrap-publish.yml
| if: ${{ env.OLD_HASH != env.NEW_HASH }} | ||
| run: | | ||
| git push origin | ||
| git push origin HEAD:${{ github.head_ref || github.ref_name }} |
There was a problem hiding this comment.
Template injection vulnerability in git push command.
github.head_ref is directly interpolated into the shell command, which zizmor correctly flags as a template injection risk. Although GitHub restricts many special characters in branch names and the workflow already blocks fork PRs, the recommended practice is to use an intermediate environment variable for proper shell escaping.
🛡️ Proposed fix using environment variable
- name: Push Changes To Remote
if: ${{ env.OLD_HASH != env.NEW_HASH }}
run: |
- git push origin HEAD:${{ github.head_ref || github.ref_name }}
+ git push origin "HEAD:${TARGET_REF}"
git push -u origin "npm-raindex-v${{ env.RAINDEX_NEW_VERSION }}-uc-v${{ env.UC_NEW_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TARGET_REF: ${{ github.head_ref || github.ref_name }}🧰 Tools
🪛 zizmor (1.25.2)
[error] 217-217: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 217-217: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
🤖 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/npm-package-release.yml at line 217, The git push line
interpolates github.head_ref directly into the shell which risks template
injection; fix it by assigning the branch expression to a workflow environment
variable (e.g., GIT_REF = ${{ github.head_ref || github.ref_name }}) and then
use a quoted env variable in the push command (git push origin HEAD:"$GIT_REF")
so the shell receives a single safely-escaped argument; update the workflow step
that contains git push origin HEAD:${{ github.head_ref || github.ref_name }} to
use the GIT_REF env var and ensure the push command uses double quotes around
$GIT_REF.
Motivation
The npm package release workflow is failing while bumping ui-components because npm tries to resolve @rainlanguage/raindex from the public registry before the renamed package has been published.
Solution
Checks
Summary by CodeRabbit