Skip to content

Commit 37059ba

Browse files
Restore workflow gate files from upstream main.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d393558 commit 37059ba

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/claude-review.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,51 @@ 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: Checkout repository
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
34+
with:
35+
fetch-depth: 1
36+
37+
- name: Check Contributor+ membership
38+
id: check
39+
uses: ./.github/actions/composite/isContributorPlus
40+
with:
41+
USERNAME: ${{ github.event.review.user.login }}
42+
OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
43+
2344
review:
24-
needs: [validate]
45+
needs: [validate, checkCPlusApproval]
2546
if: |
26-
needs.validate.outputs.IS_AUTHORIZED == 'true'
47+
!cancelled()
2748
&& github.event.pull_request.draft != true
2849
&& !contains(github.event.pull_request.title, 'Revert')
29-
runs-on: ubuntu-latest
50+
&& (
51+
(github.event_name == 'pull_request_target' && needs.validate.outputs.IS_AUTHORIZED == 'true')
52+
|| (github.event_name == 'pull_request_review' && needs.checkCPlusApproval.outputs.IS_CPLUS == 'true')
53+
)
54+
runs-on: blacksmith-2vcpu-ubuntu-2404
3055
env:
3156
PR_NUMBER: ${{ github.event.pull_request.number }}
3257
steps:

.github/workflows/contributorValidationGate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
check:
29-
runs-on: ubuntu-latest
29+
runs-on: blacksmith-2vcpu-ubuntu-2404
3030
outputs:
3131
IS_AUTHORIZED: ${{ steps.gate.outputs.IS_AUTHORIZED }}
3232
steps:

0 commit comments

Comments
 (0)