Skip to content

Commit 08e2d1e

Browse files
authored
Merge pull request #111 from AdjectiveAllison/ci_claude
lesss go
2 parents e1268f6 + c12c61e commit 08e2d1e

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jobs:
1111
contents: read
1212
pull-requests: write
1313
issues: write
14+
discussions: write
15+
id-token: write
16+
statuses: write
17+
workflow: write
18+
actions: write
1419
steps:
1520
# Check out the code to allow git diff operations
1621
- name: Checkout code

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

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
discussions: write
1616
id-token: write
1717
statuses: write
18+
workflow: write
19+
actions: write
1820
steps:
1921
- name: Checkout code
2022
uses: actions/checkout@v4
@@ -25,19 +27,32 @@ jobs:
2527
- name: Checkout PR branch if needed
2628
if: github.event.issue.pull_request
2729
env:
28-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2931
run: |
3032
# Get the PR number from the issue object
3133
PR_NUMBER="${{ github.event.issue.number }}"
3234
3335
echo "Checking out PR #${PR_NUMBER}"
3436
35-
# Use GitHub CLI to checkout the PR
36-
# This handles both internal branches and forks automatically
37-
gh pr checkout ${PR_NUMBER}
37+
# Get PR info
38+
PR_INFO=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
39+
"https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER")
3840
39-
echo "Current branch: $(git branch --show-current)"
41+
# Extract the PR branch ref and other details
42+
PR_BRANCH=$(echo "$PR_INFO" | jq -r .head.ref)
43+
PR_SHA=$(echo "$PR_INFO" | jq -r .head.sha)
44+
PR_REPO=$(echo "$PR_INFO" | jq -r .head.repo.full_name)
45+
46+
echo "PR branch is $PR_BRANCH from repo $PR_REPO with commit SHA $PR_SHA"
47+
48+
# Fetch the PR as a local branch (works for forks too)
49+
git fetch origin "pull/$PR_NUMBER/head:pr-$PR_NUMBER"
50+
git checkout "pr-$PR_NUMBER"
51+
52+
# Verify checkout
53+
echo "Current branch details:"
4054
git status
55+
git rev-parse HEAD
4156
4257
- name: Claude Response
4358
uses: anthropics/claude-code-action@beta

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
discussions: write
2121
id-token: write
2222
statuses: write
23+
workflow: write
24+
actions: write
2325
steps:
2426
- name: Checkout code
2527
uses: actions/checkout@v4

0 commit comments

Comments
 (0)