-
-
Notifications
You must be signed in to change notification settings - Fork 107
Add Claude Code GitHub Workflow #3979
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| name: Claude Code Review | ||||||
|
|
||||||
| on: | ||||||
| pull_request_target: | ||||||
| pull_request: | ||||||
| types: [opened, synchronize] | ||||||
| # Optional: Only run on specific file changes | ||||||
| # paths: | ||||||
|
|
@@ -17,62 +17,41 @@ jobs: | |||||
| # github.event.pull_request.user.login == 'external-contributor' || | ||||||
| # github.event.pull_request.user.login == 'new-developer' || | ||||||
| # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' | ||||||
|
|
||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
| pull-requests: read | ||||||
| issues: read | ||||||
| id-token: write | ||||||
|
||||||
| id-token: write |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions/checkout action is downgraded to @v4 while other workflows in this repository use @v6. This inconsistency should be avoided. Consider updating to @v6 to match the rest of the repository's workflows (e.g., .github/workflows/codeql.yml, .github/workflows/dotnet.yml, etc.).
| uses: actions/checkout@v4 | |
| uses: actions/checkout@v6 |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The claude_args grants Claude access to various gh CLI commands including gh pr comment. Combined with the pull_request trigger (line 4), this could allow a malicious PR to execute these commands with the workflow's permissions. Consider either:
- Reverting to
pull_request_targettrigger for better security - Adding strict conditions to limit when this workflow runs (e.g., filtering by author or requiring approval)
- Reducing the allowed tools to read-only operations only
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,39 +26,25 @@ jobs: | |||||
| actions: read # Required for Claude to read CI results on PRs | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@v6 | ||||||
| uses: actions/checkout@v4 | ||||||
|
||||||
| uses: actions/checkout@v4 | |
| uses: actions/checkout@v6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the trigger from
pull_request_targettopull_requesthas significant security implications. Withpull_request, the workflow runs in the context of the PR branch (including code from potentially untrusted contributors), giving it access to secrets likeCLAUDE_CODE_OAUTH_TOKEN. This could allow malicious actors to exfiltrate secrets by modifying the workflow file or repository code in their PR.pull_request_targetis the safer choice for workflows that need secrets and run on PRs from forks, as it executes in the context of the base repository. If you need to usepull_request, ensure you have strict controls on who can open PRs or consider removing access to sensitive secrets.