-
Notifications
You must be signed in to change notification settings - Fork 3
Add Claude review action #5
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,45 +1,86 @@ | ||||||||||||||
| name: Claude Code | ||||||||||||||
| name: Claude Code Review with Progress Tracking | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| issue_comment: | ||||||||||||||
| types: [created] | ||||||||||||||
| pull_request_review_comment: | ||||||||||||||
| types: [created, synchronize, ready_for_review, reopened] | ||||||||||||||
| types: [created, edited, deleted] | ||||||||||||||
| issues: | ||||||||||||||
| types: [opened, assigned] | ||||||||||||||
|
Comment on lines
8
to
9
|
||||||||||||||
| issues: | |
| types: [opened, assigned] |
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.
Issue: Changed from issues: read to issues: write
The permission was escalated from read to write. While this may be intentional for the progress tracking feature, it's worth noting:
Security consideration:
issues: writeallows creating, editing, and deleting issues- If this is only needed for commenting on issues, that's already covered by the action's behavior
- Consider if
readis sufficient for your use case
If you need to update comments on issues, the pull-requests: write permission already covers that for PR-related comments.
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.
Security Concern: Overly permissive actions: write permission
The actions: write permission grants the ability to manage GitHub Actions workflows and workflow runs. This is a broad permission that could be exploited if the workflow is compromised.
Questions:
- Is this permission actually needed? I don't see it being used in the workflow steps.
- If it's not required, it should be removed following the principle of least privilege.
Recommendation: Remove actions: write unless you have a specific use case that requires it.
Copilot
AI
Jan 13, 2026
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: write permission on line 19 appears to be unnecessary for this workflow. The workflow doesn't cancel workflows, create workflow dispatches, or perform other actions that require this permission. Including unnecessary permissions violates the principle of least privilege. Consider removing this permission unless there's a specific requirement for it.
| actions: write |
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.
Deprecation Warning: actions/checkout@v4 vs @v5
You've downgraded from actions/checkout@v5 (in the old version) to @v4. While v4 is still supported, v5 is the latest version with improvements and bug fixes.
Recommendation: Use actions/checkout@v5 for the latest features and security updates unless you have a specific reason to use v4.
Copilot
AI
Jan 13, 2026
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 downgrade from actions/checkout@v5 to @v4 is inconsistent with best practices. Unless there's a specific compatibility issue with v5, workflows should use the latest stable version to benefit from security patches and improvements. Consider using actions/checkout@v5 or document the reason for the downgrade.
| uses: actions/checkout@v4 | |
| uses: actions/checkout@v5 |
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.
Good Practice: fetch-depth: 0 for full history
✅ Good change! This fetches the full git history, which is important for:
- Accurate diff comparisons
- Understanding PR context
- Accessing commit history
The previous fetch-depth: 1 was too shallow for comprehensive PR reviews.
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.
Potential Issue: github.event.pull_request.head.sha may not exist for all event types
The ref selection logic:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}This works for pull_request_target, but for other event types (like issue_comment), this will fall back to github.sha, which might not be the PR's HEAD if the comment is on a PR.
Recommendation: The subsequent step (lines 59-65) handles PR checkout for comment events, so this is probably fine. But consider adding a comment to clarify this two-step checkout strategy.
Copilot
AI
Jan 13, 2026
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 pull_request_target event is used with untrusted code checkout, which is a critical security risk. Line 58 checks out the PR head SHA directly, which means untrusted code from external contributors could be executed with access to repository secrets (ANTHROPIC_API_KEY, GITHUB_TOKEN). Since the conditional only checks author_association, malicious actors could become collaborators or the association check could be bypassed. Consider using a two-job approach: one job with pull_request_target to get tokens, and another with pull_request to run untrusted code without secret access.
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }} |
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.
Logic Issue: PR checkout step may fail for non-PR events
This step attempts to checkout a PR branch, but the condition might not cover all cases correctly:
Problems:
github.event.issue.numberwon't exist forpull_request_review_commentevents (it'sgithub.event.pull_request.numberinstead)- The
gh pr checkoutcommand requires the PR number, but for regular issue comments (non-PR),github.event.issue.numberwould be an issue number, not a PR number - This step will run for issue comments, but issue comments aren't always on PRs
Recommendation: Add better conditionals to ensure this only runs for PR-related comment events:
- name: Checkout PR Branch (for comments)
if: ${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request) || github.event_name == 'pull_request_review_comment' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.issue.number || github.event.pull_request.number }}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.
Guard issue_comment events to only run on PRs
The job runs on any issue_comment with @claude, which includes comments on plain issues. For those events the payload has no pull_request, yet the workflow still executes gh pr checkout ${{ github.event.issue.number || github.event.pull_request.number }}. That leaves no PR to resolve and the job will fail for non‑PR issues that mention @claude. Consider gating this step (or the whole job) on github.event.issue.pull_request or restricting the trigger to PR-only comments.
Useful? React with 👍 / 👎.
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.
Guard issue_comment runs to PRs before checkout
This workflow runs on any issue_comment that contains @claude from a trusted user, even if the comment is on a plain issue. In that case there is no PR associated with the issue number, yet the step still executes gh pr checkout ${{ github.event.issue.number }}, which will fail because that number does not correspond to a PR. This means any @claude comment on a non‑PR issue will reliably break the job. Consider adding a guard for github.event.issue.pull_request or restricting the trigger to PR comments only.
Useful? React with 👍 / 👎.
Copilot
AI
Jan 13, 2026
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 checkout step in lines 60-65 attempts to use gh pr checkout to switch branches, but this runs after the repository has already been checked out in line 55. This creates conflicting checkout states and may not work as intended. For issue_comment and pull_request_review_comment events, the PR number may not be directly available in github.event.issue.number or github.event.pull_request.number. Additionally, gh pr checkout requires the GitHub CLI to be available, which may not be pre-installed. Consider removing this step and relying on the ref parameter in the first checkout step to handle all cases correctly.
| - name: Checkout PR Branch (for comments) | |
| if: ${{ github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr checkout ${{ github.event.issue.number || github.event.pull_request.number }} |
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.
New Feature: show_full_output: true
This is a new configuration option. Consider:
Documentation:
- What does this option do?
- Does it affect security (e.g., by exposing sensitive information in logs)?
- Is this needed for debugging, or should it be configurable/optional?
If this is purely for debugging, consider whether it should be enabled in production.
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.
Issue: Incorrect event types for
pull_request_review_commentThe
pull_request_review_commentevent only supportscreated,edited, anddeletedtypes. However,synchronize,ready_for_review, andreopenedare not valid for this event type - they belong to thepull_requestorpull_request_targetevents.This will cause the workflow to never trigger on those invalid event types for this event.
Recommendation: Remove
synchronize,ready_for_review, andreopenedfrom line 7, or move them to apull_requestevent trigger.GitHub Actions Events Documentation