Skip to content

Commit 90aec15

Browse files
committed
more perms to write
1 parent 7b72148 commit 90aec15

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/claude.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,30 @@ jobs:
1919
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
2020
runs-on: ubuntu-latest
2121
permissions:
22-
contents: read
23-
pull-requests: read
22+
contents: write
23+
pull-requests: write
2424
issues: read
2525
id-token: write
2626
actions: read # Required for Claude to read CI results on PRs
2727
steps:
28+
- name: Get PR head ref
29+
id: pr-ref
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
run: |
33+
# For issue_comment events, we need to fetch the PR info
34+
if [ "${{ github.event_name }}" = "issue_comment" ]; then
35+
PR_REF=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} --jq '.head.ref')
36+
echo "ref=$PR_REF" >> $GITHUB_OUTPUT
37+
else
38+
echo "ref=${{ github.event.pull_request.head.ref || github.head_ref }}" >> $GITHUB_OUTPUT
39+
fi
40+
2841
- name: Checkout repository
2942
uses: actions/checkout@v4
3043
with:
31-
fetch-depth: 1
44+
fetch-depth: 0
45+
ref: ${{ steps.pr-ref.outputs.ref }}
3246

3347
- name: Run Claude Code
3448
id: claude

0 commit comments

Comments
 (0)