Skip to content

Commit e1268f6

Browse files
authored
Merge pull request #110 from AdjectiveAllison/fix_other_ci_claude
get code for PR if @claude is on PR
2 parents 49255d6 + f3b54e8 commit e1268f6

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
permissions:
1111
contents: read
1212
pull-requests: write
13+
issues: write
1314
steps:
1415
# Check out the code to allow git diff operations
1516
- name: Checkout code

.github/workflows/claude-comment-response.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,33 @@ jobs:
1212
contents: write
1313
pull-requests: write
1414
issues: write
15+
discussions: write
16+
id-token: write
17+
statuses: write
1518
steps:
1619
- name: Checkout code
1720
uses: actions/checkout@v4
1821
with:
1922
fetch-depth: 0 # Fetch full history for accurate diffs
2023

24+
# If running on a PR comment, we need to explicitly check out the PR branch
25+
- name: Checkout PR branch if needed
26+
if: github.event.issue.pull_request
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
# Get the PR number from the issue object
31+
PR_NUMBER="${{ github.event.issue.number }}"
32+
33+
echo "Checking out PR #${PR_NUMBER}"
34+
35+
# Use GitHub CLI to checkout the PR
36+
# This handles both internal branches and forks automatically
37+
gh pr checkout ${PR_NUMBER}
38+
39+
echo "Current branch: $(git branch --show-current)"
40+
git status
41+
2142
- name: Claude Response
2243
uses: anthropics/claude-code-action@beta
2344
with:
@@ -49,7 +70,6 @@ jobs:
4970
GlobTool # Find files by pattern
5071
GrepTool # Search file contents
5172
BatchTool # Run multiple tools in parallel
52-
5373
5474
# Timeout after 20 minutes
5575
timeout_minutes: 20

.github/workflows/claude-pr-creation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
contents: write
1818
pull-requests: write
1919
issues: write
20+
discussions: write
21+
id-token: write
22+
statuses: write
2023
steps:
2124
- name: Checkout code
2225
uses: actions/checkout@v4

0 commit comments

Comments
 (0)