Skip to content

Commit 8f301d4

Browse files
committed
Skip review workflow for phpstan-bot
1 parent 886ebe2 commit 8f301d4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,35 @@ permissions:
3030
contents: read
3131

3232
jobs:
33+
check-reviewer:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 5
36+
permissions:
37+
contents: read
38+
outputs:
39+
skip: ${{ steps.check.outputs.skip }}
40+
steps:
41+
- name: Harden the runner (Audit all outbound calls)
42+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
43+
with:
44+
egress-policy: audit
45+
46+
- name: Check if review is from phpstan-bot
47+
id: check
48+
env:
49+
GH_TOKEN: ${{ secrets.PHPSTAN_BOT_PR_TOKEN }}
50+
run: |
51+
reviewer=$(gh api "repos/phpstan/phpstan/pulls/${{ inputs.pr_number }}/reviews/${{ inputs.review_id }}" --jq '.user.login')
52+
if [ "$reviewer" = "phpstan-bot" ]; then
53+
echo "Skipping review from phpstan-bot"
54+
echo "skip=true" >> "$GITHUB_OUTPUT"
55+
else
56+
echo "skip=false" >> "$GITHUB_OUTPUT"
57+
fi
58+
3359
respond:
60+
needs: check-reviewer
61+
if: needs.check-reviewer.outputs.skip != 'true'
3462
runs-on: ubuntu-latest
3563
timeout-minutes: 30
3664
permissions:

0 commit comments

Comments
 (0)