-
Notifications
You must be signed in to change notification settings - Fork 22
Run claude for PR reviews #4511
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| steps: | ||
| - name: Debug | ||
| run: | | ||
| echo "github.event: ${{ fromJSON(github.event) }}" |
Check failure
Code scanning / CodeQL
Code injection Critical
${ fromJSON(github.event) }
issue_comment
Potential code injection in
${ fromJSON(github.event) }
pull_request_review_comment
Potential code injection in
${ fromJSON(github.event) }
issues
Potential code injection in
${ fromJSON(github.event) }
pull_request_review
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 10 days ago
To fix the code injection vulnerability, we should avoid direct interpolation of user-controlled values into shell commands. Specifically, instead of using echo "github.event: ${{ fromJSON(github.event) }}" directly, assign the value of ${{ toJSON(github.event) }} to an environment variable, then access it in the shell step using native shell variable expansion (e.g., "$EVENT"). This prevents any shell metacharacters in the event payload from being evaluated/executed by the shell.
- Edit the debug job's step that currently echoes
github.eventusing expression interpolation. - Move the event value assignment to an environment variable via the
env:block. - Access that variable using
$EVENTin the shell command, thus neutralizing code injection risks. - Use
toJSONinstead offromJSONfor proper string formatting (as in GitHub Actions best practices for dumping event payloads).
-
Copy modified lines R20-R21 -
Copy modified line R23
| @@ -17,8 +17,10 @@ | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Debug | ||
| env: | ||
| EVENT: ${{ toJSON(github.event) }} | ||
| run: | | ||
| echo "github.event: ${{ fromJSON(github.event) }}" | ||
| echo "github.event: $EVENT" | ||
| claude: | ||
| if: | | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
What
ToDo