Skip to content

Commit b31a553

Browse files
committed
Run Claude PR reviewer on Contributor+ approval
Adds a pull_request_review trigger so the Claude code/docs review re-runs when a member of the contributor-plus GitHub team submits an approved review. The existing pull_request_target (opened, ready_for_review) trigger and the author authorization gate are preserved. Made-with: Cursor
1 parent cd199f8 commit b31a553

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/claude-review.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,52 @@ permissions:
77
on:
88
pull_request_target:
99
types: [opened, ready_for_review]
10+
pull_request_review:
11+
types: [submitted]
1012

1113
concurrency:
1214
group: claude-review-${{ github.event.pull_request.html_url }}
1315
cancel-in-progress: true
1416

1517
jobs:
1618
validate:
19+
if: github.event_name == 'pull_request_target'
1720
uses: ./.github/workflows/contributorValidationGate.yml
1821
with:
1922
PR_NUMBER: ${{ github.event.pull_request.number }}
2023
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
2124
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
2225

26+
checkCPlusApproval:
27+
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved'
28+
runs-on: blacksmith-2vcpu-ubuntu-2404
29+
outputs:
30+
IS_CPLUS: ${{ steps.check.outputs.IS_CPLUS }}
31+
steps:
32+
- name: Check Contributor+ membership
33+
id: check
34+
env:
35+
GH_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
36+
REVIEWER: ${{ github.event.review.user.login }}
37+
run: |
38+
if gh api "/orgs/Expensify/teams/contributor-plus/memberships/$REVIEWER" --silent; then
39+
echo "::notice::✅ Reviewer $REVIEWER is a Contributor+ member"
40+
echo "IS_CPLUS=true" >> "$GITHUB_OUTPUT"
41+
else
42+
echo "::notice::Reviewer $REVIEWER is not a Contributor+ member; skipping Claude review"
43+
echo "IS_CPLUS=false" >> "$GITHUB_OUTPUT"
44+
fi
45+
2346
review:
24-
needs: [validate]
47+
needs: [validate, checkCPlusApproval]
2548
if: |
26-
needs.validate.outputs.IS_AUTHORIZED == 'true'
49+
!cancelled()
2750
&& github.event.pull_request.draft != true
2851
&& !contains(github.event.pull_request.title, 'Revert')
52+
&& (
53+
(github.event_name == 'pull_request_target' && needs.validate.outputs.IS_AUTHORIZED == 'true')
54+
|| (github.event_name == 'pull_request_review' && needs.checkCPlusApproval.outputs.IS_CPLUS == 'true')
55+
)
2956
runs-on: blacksmith-2vcpu-ubuntu-2404
3057
env:
3158
PR_NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)