fix: correct environment variable setup and PowerShell syntax - #203
Conversation
- Use GITHUB_ENV instead of GITHUB_OUTPUT for setting env vars - Change %VAR% to :VAR for PowerShell compatibility - Fix PR_NUMBER to use pr_number output in ai-implement.yml
|
Warning Rate limit exceeded
⌛ 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
|
Claude finished @ModerRAS's task —— View job Code Review: PR #203 - Environment Variable and PowerShell Syntax FixesI've reviewed the changes in this PR that fixes environment variable setup and PowerShell syntax in GitHub Actions workflows. Here's my analysis: ✅ Positive Changes
|
There was a problem hiding this comment.
Pull request overview
Fixes GitHub Actions workflow variable propagation and Windows/PowerShell-specific syntax so downstream steps can correctly consume ISSUE_NUM / PR_NUMBER.
Changes:
- Switch env-var export to
GITHUB_ENV(instead ofGITHUB_OUTPUT) for step-to-step environment variables - Update command syntax to PowerShell-style environment variable references
- Adjust branch naming / prompt placeholder replacement to use the new env-var approach
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| .github/workflows/ai-iterate.yml | Writes ISSUE_NUM/PR_NUMBER to GITHUB_ENV and updates prompt/branch usage accordingly |
| .github/workflows/ai-implement.yml | Writes env vars to GITHUB_ENV and updates branch/prompt/github-script usage accordingly |
You can also share your feedback on Copilot code review. Take the survey.
| echo "ISSUE_NUM=${{ steps.extract.outputs.issue_number }}" >> $env:GITHUB_ENV | ||
| echo "PR_NUMBER=${{ steps.extract.outputs.issue_number }}" >> $env:GITHUB_ENV |
| echo "ISSUE_NUM=${{ steps.extract.outputs.issue_number }}" >> $env:GITHUB_ENV | ||
| echo "PR_NUMBER=${{ steps.extract.outputs.pr_number }}" >> $env:GITHUB_ENV |
| git add -A | ||
| git commit -m "AI: Iterate based on feedback" 2>nul | ||
| git push origin "ai/issue-%ISSUE_NUM%" 2>nul | ||
| git push origin "ai/issue-$env:ISSUE_NUM" 2>nul |
| powershell -Command "$content = Get-Content '.github/workflows/oh-my-opencode.json' -Raw; $content = $content -replace 'MINIMAX_API_KEY', $env:MINIMAX_API_KEY; Set-Content -Path $env:USERPROFILE\\.config\\opencode\\oh-my-opencode.json -Value $content" | ||
|
|
||
| node -e "const fs=require('fs');const c=JSON.parse(process.env.COMMENTS_DATA);let p=fs.readFileSync('.github/workflows/prompts/ai-iterate-prompt.txt','utf8');p=p.replace(/{{issue_number}}/g,'%ISSUE_NUM%').replace(/{{pr_number}}/g,'%PR_NUMBER%').replace(/{{comments}}/g,c.join('\n\n'));fs.writeFileSync('prompt.txt',p);" | ||
| node -e "const fs=require('fs');const c=JSON.parse(process.env.COMMENTS_DATA);let p=fs.readFileSync('.github/workflows/prompts/ai-iterate-prompt.txt','utf8');p=p.replace(/{{issue_number}}/g,'$env:ISSUE_NUM').replace(/{{pr_number}}/g,'$env:PR_NUMBER').replace(/{{comments}}/g,c.join('\n\n'));fs.writeFileSync('prompt.txt',p);" |
| const fs = require('fs'); | ||
| let p = fs.readFileSync('.github/workflows/prompts/ai-fix-tests-prompt.txt','utf8'); | ||
| p = p.replace(/{{issue_number}}/g, '%ISSUE_NUM%'); | ||
| p = p.replace(/{{issue_number}}/g, '$env:ISSUE_NUM'); |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh pr create --base main --head "ai/issue-%ISSUE_NUM%" --title "AI: Issue #%ISSUE_NUM%" --body "AI implementation" 2>nul || echo PR exists | ||
| gh pr create --base main --head "ai/issue-$env:ISSUE_NUM" --title "AI: Issue #$env:ISSUE_NUM" --body "AI implementation" 2>nul || echo PR exists |
| script: | | ||
| await github.rest.issues.addLabels({ | ||
| issue_number: parseInt('%ISSUE_NUM%'), | ||
| issue_number: parseInt('$env:ISSUE_NUM'), |
🔍 PR检查报告📋 检查概览
🧪 测试结果
📊 代码质量
📁 测试产物
🔗 相关链接此报告由GitHub Actions自动生成 |

Summary