Skip to content

Commit fe15c43

Browse files
authored
Merge pull request #12 from hotdata-dev/fix/dependabot-pr-review
fix: auto-approve Dependabot PRs without GitHub App token
2 parents 6896a82 + 81bb4d9 commit fe15c43

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ jobs:
2222
with:
2323
fetch-depth: 1
2424

25+
- name: Auto-approve Dependabot bump
26+
if: github.actor == 'dependabot[bot]'
27+
run: gh pr review ${{ github.event.pull_request.number }} --approve --body "Automated dependency bump — auto-approved."
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
2531
- name: Generate GitHub App token
32+
if: github.actor != 'dependabot[bot]'
2633
id: app-token
2734
uses: actions/create-github-app-token@v3.2.0
2835
with:
@@ -31,6 +38,7 @@ jobs:
3138
owner: hotdata-dev
3239

3340
- uses: actions/checkout@v6.0.2
41+
if: github.actor != 'dependabot[bot]'
3442
with:
3543
repository: hotdata-dev/github-workflows
3644
ref: main
@@ -40,6 +48,7 @@ jobs:
4048
sparse-checkout-cone-mode: false
4149

4250
- name: Load review prompt
51+
if: github.actor != 'dependabot[bot]'
4352
id: prompt
4453
run: |
4554
PROMPT=$(cat .github-workflows/docs/claude-pr-review-prompt.md)
@@ -48,9 +57,11 @@ jobs:
4857
echo "EOF" >> $GITHUB_OUTPUT
4958
5059
- name: Verify jq is available
60+
if: github.actor != 'dependabot[bot]'
5161
run: jq --version
5262

5363
- name: Gather review context
64+
if: github.actor != 'dependabot[bot]'
5465
id: context
5566
run: |
5667
PR_NUMBER=${{ github.event.pull_request.number }}
@@ -85,6 +96,7 @@ jobs:
8596
GH_TOKEN: ${{ github.token }}
8697

8798
- uses: anthropics/claude-code-action@v1
99+
if: github.actor != 'dependabot[bot]'
88100
id: review
89101
continue-on-error: true
90102
with:
@@ -107,7 +119,7 @@ jobs:
107119
--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"
108120
109121
- name: Notify on review failure
110-
if: steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled'
122+
if: github.actor != 'dependabot[bot]' && (steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled')
111123
run: gh pr comment ${{ github.event.pull_request.number }} --body "Automated review unavailable (Claude step failed). Please review manually."
112124
env:
113125
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)