Skip to content

Commit 70a94ea

Browse files
authored
Merge pull request #1178 from btcsuite/fix-claude-workflow-pr-checkout
ci: fix claude workflow for fork PRs
2 parents b3a80e0 + a23b34c commit 70a94ea

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/claude.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,26 @@ jobs:
3030
with:
3131
fetch-depth: 1
3232

33+
- name: Checkout PR branch (handles fork PRs)
34+
if: github.event.issue.pull_request || github.event_name == 'pull_request_review_comment' || github.event_name == 'pull_request_review'
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
if [ "${{ github.event_name }}" = "issue_comment" ]; then
39+
PR_NUMBER=${{ github.event.issue.number }}
40+
else
41+
PR_NUMBER=${{ github.event.pull_request.number }}
42+
fi
43+
gh pr checkout "$PR_NUMBER"
44+
3345
- name: Run Claude Code
3446
id: claude
3547
uses: anthropics/claude-code-action@v1
3648
with:
3749
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38-
model: claude-opus-4-6
50+
claude_args: '--model claude-opus-4-6'
3951

4052
# This is an optional setting that allows Claude to read CI results on PRs
4153
additional_permissions: |
4254
actions: read
4355
44-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
45-
# prompt: 'Update the pull request description to include a summary of changes.'
46-
47-
# Optional: Add claude_args to customize behavior and configuration
48-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
49-
# or https://code.claude.com/docs/en/cli-reference for available options
50-
# claude_args: '--allowed-tools Bash(gh pr:*)'
51-

0 commit comments

Comments
 (0)