-
Notifications
You must be signed in to change notification settings - Fork 66
56 lines (51 loc) · 2.35 KB
/
require_backend_label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Label Pull Request Reviewers
on:
pull_request:
types: [opened, reopened, review_requested, synchronize, ready_for_review, unlabeled]
jobs:
label-pr-codeowners:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Require require-backend-approval label
if: github.event.action == 'unlabeled' && github.event.label.name == 'require-backend-approval'
uses: actions-ecosystem/action-add-labels@v1
with:
number: ${{ github.event.pull_request.number }}
labels: |
require-backend-approval
- name: Require omit-backend-approval label
if: github.event.action == 'unlabeled' && github.event.label.name == 'omit-backend-approval'
uses: actions-ecosystem/action-add-labels@v1
with:
number: ${{ github.event.pull_request.number }}
labels: |
omit-backend-approval
- name: Add omit-backend-approval label
if: |
!contains(github.event.pull_request.labels.*.name, 'require-backend-approval') &&
!contains(github.event.pull_request.labels.*.name, 'omit-backend-approval') &&
(
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'mobile') ||
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'lighthouse') ||
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'identity')
)
uses: actions-ecosystem/action-add-labels@v1
with:
number: ${{ github.event.pull_request.number }}
labels: |
omit-backend-approval
- name: Add require-backend-approval label
uses: actions-ecosystem/action-add-labels@v1
if: |
!contains(github.event.pull_request.labels.*.name, 'require-backend-approval') &&
!contains(github.event.pull_request.labels.*.name, 'omit-backend-approval') &&
!contains(toJSON(github.event.pull_request.requested_teams.*.name), 'mobile') &&
!contains(toJSON(github.event.pull_request.requested_teams.*.name), 'lighthouse') &&
!contains(toJSON(github.event.pull_request.requested_teams.*.name), 'identity')
with:
number: ${{ github.event.pull_request.number }}
labels: |
require-backend-approval