fix(ci): add explicit github_token for pull_request_target
The OIDC token exchange fails with pull_request_target events. Provide explicit github_token to fix authentication. Also upgrade to pull-requests: write for posting comments.
This commit is contained in:
parent
b4042da156
commit
f558c14b24
1 changed files with 3 additions and 1 deletions
4
.github/workflows/claude-code-review.yml
vendored
4
.github/workflows/claude-code-review.yml
vendored
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: read
|
pull-requests: write # Needed to post review comments
|
||||||
issues: read
|
issues: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
|
|
@ -55,6 +55,8 @@ jobs:
|
||||||
uses: anthropics/claude-code-action@v1
|
uses: anthropics/claude-code-action@v1
|
||||||
with:
|
with:
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
# Explicit github_token needed for pull_request_target (OIDC doesn't work)
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
prompt: |
|
prompt: |
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
PR NUMBER: ${{ github.event.pull_request.number }}
|
PR NUMBER: ${{ github.event.pull_request.number }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue