Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
contents: read
pull-requests: write
issues: write
discussions: write
id-token: write
statuses: write
workflow: write
actions: write
steps:
# Check out the code to allow git diff operations
- name: Checkout code
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/claude-comment-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
discussions: write
id-token: write
statuses: write
workflow: write
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -25,19 +27,32 @@ jobs:
- name: Checkout PR branch if needed
if: github.event.issue.pull_request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the PR number from the issue object
PR_NUMBER="${{ github.event.issue.number }}"

echo "Checking out PR #${PR_NUMBER}"

# Use GitHub CLI to checkout the PR
# This handles both internal branches and forks automatically
gh pr checkout ${PR_NUMBER}
# Get PR info
PR_INFO=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
Comment thread
allisoneer marked this conversation as resolved.
"https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER")

echo "Current branch: $(git branch --show-current)"
# Extract the PR branch ref and other details
PR_BRANCH=$(echo "$PR_INFO" | jq -r .head.ref)
PR_SHA=$(echo "$PR_INFO" | jq -r .head.sha)
PR_REPO=$(echo "$PR_INFO" | jq -r .head.repo.full_name)

echo "PR branch is $PR_BRANCH from repo $PR_REPO with commit SHA $PR_SHA"

# Fetch the PR as a local branch (works for forks too)
git fetch origin "pull/$PR_NUMBER/head:pr-$PR_NUMBER"
git checkout "pr-$PR_NUMBER"

# Verify checkout
echo "Current branch details:"
git status
git rev-parse HEAD

- name: Claude Response
uses: anthropics/claude-code-action@beta
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/claude-pr-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
discussions: write
id-token: write
statuses: write
workflow: write
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down