Skip to content

Commit 9746e81

Browse files
authored
fix: use pull_request.user.login instead of github.actor for Dependabot check (#13)
github.actor is set to the workflow runner identity (github-actions[bot]) in org-required workflows, not the PR author. Switch to github.event.pull_request.user.login which always reflects who opened the PR. Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
1 parent fe15c43 commit 9746e81

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
fetch-depth: 1
2424

2525
- name: Auto-approve Dependabot bump
26-
if: github.actor == 'dependabot[bot]'
26+
if: github.event.pull_request.user.login == 'dependabot[bot]'
2727
run: gh pr review ${{ github.event.pull_request.number }} --approve --body "Automated dependency bump — auto-approved."
2828
env:
2929
GH_TOKEN: ${{ github.token }}
3030

3131
- name: Generate GitHub App token
32-
if: github.actor != 'dependabot[bot]'
32+
if: github.event.pull_request.user.login != 'dependabot[bot]'
3333
id: app-token
3434
uses: actions/create-github-app-token@v3.2.0
3535
with:
@@ -38,7 +38,7 @@ jobs:
3838
owner: hotdata-dev
3939

4040
- uses: actions/checkout@v6.0.2
41-
if: github.actor != 'dependabot[bot]'
41+
if: github.event.pull_request.user.login != 'dependabot[bot]'
4242
with:
4343
repository: hotdata-dev/github-workflows
4444
ref: main
@@ -48,7 +48,7 @@ jobs:
4848
sparse-checkout-cone-mode: false
4949

5050
- name: Load review prompt
51-
if: github.actor != 'dependabot[bot]'
51+
if: github.event.pull_request.user.login != 'dependabot[bot]'
5252
id: prompt
5353
run: |
5454
PROMPT=$(cat .github-workflows/docs/claude-pr-review-prompt.md)
@@ -57,11 +57,11 @@ jobs:
5757
echo "EOF" >> $GITHUB_OUTPUT
5858
5959
- name: Verify jq is available
60-
if: github.actor != 'dependabot[bot]'
60+
if: github.event.pull_request.user.login != 'dependabot[bot]'
6161
run: jq --version
6262

6363
- name: Gather review context
64-
if: github.actor != 'dependabot[bot]'
64+
if: github.event.pull_request.user.login != 'dependabot[bot]'
6565
id: context
6666
run: |
6767
PR_NUMBER=${{ github.event.pull_request.number }}
@@ -96,7 +96,7 @@ jobs:
9696
GH_TOKEN: ${{ github.token }}
9797

9898
- uses: anthropics/claude-code-action@v1
99-
if: github.actor != 'dependabot[bot]'
99+
if: github.event.pull_request.user.login != 'dependabot[bot]'
100100
id: review
101101
continue-on-error: true
102102
with:
@@ -119,7 +119,7 @@ jobs:
119119
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review:*),Read"
120120
121121
- name: Notify on review failure
122-
if: github.actor != 'dependabot[bot]' && (steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled')
122+
if: github.event.pull_request.user.login != 'dependabot[bot]' && (steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled')
123123
run: gh pr comment ${{ github.event.pull_request.number }} --body "Automated review unavailable (Claude step failed). Please review manually."
124124
env:
125125
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)