File tree Expand file tree Collapse file tree 4 files changed +50
-21
lines changed Expand file tree Collapse file tree 4 files changed +50
-21
lines changed Original file line number Diff line number Diff line change 1
1
name : (Compiler) Discord Notify
2
2
3
3
on :
4
- pull_request_target :
5
- types : [labeled]
4
+ pull_request :
6
5
paths :
7
6
- compiler/**
8
7
- .github/workflows/compiler_**.yml
9
8
10
9
jobs :
10
+ check_maintainer :
11
+ uses : facebook/react/.github/workflows/shared_check_maintainer.yml@main
12
+
11
13
notify :
12
- if : ${{ github.event.label.name == 'React Core Team' }}
14
+ if : ${{ needs.check_maintainer.outputs.is_core_team }}
15
+ needs : check_maintainer
13
16
runs-on : ubuntu-latest
14
17
steps :
15
18
- name : Discord Webhook Action
Original file line number Diff line number Diff line change 1
1
name : (Runtime) Discord Notify
2
2
3
3
on :
4
- pull_request_target :
5
- types : [labeled]
4
+ pull_request :
6
5
paths-ignore :
7
6
- compiler/**
8
7
- .github/workflows/compiler_**.yml
9
8
10
9
jobs :
10
+ check_maintainer :
11
+ uses : facebook/react/.github/workflows/shared_check_maintainer.yml@main
12
+
11
13
notify :
12
- if : ${{ github.event.label.name == 'React Core Team' }}
14
+ if : ${{ needs.check_maintainer.outputs.is_core_team }}
15
+ needs : check_maintainer
13
16
runs-on : ubuntu-latest
14
17
steps :
15
18
- name : Discord Webhook Action
Original file line number Diff line number Diff line change 1
- name : (Shared) Core Label
1
+ name : (Shared) Check maintainer
2
2
3
3
on :
4
- pull_request :
4
+ workflow_call :
5
+ outputs :
6
+ is_core_team :
7
+ value : ${{ jobs.check_maintainer.outputs.is_core_team }}
5
8
6
9
env :
7
10
TZ : /usr/share/zoneinfo/America/Los_Angeles
8
11
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
9
12
SEGMENT_DOWNLOAD_TIMEOUT_MINS : 1
10
13
11
14
jobs :
12
- core_label :
15
+ check_maintainer :
13
16
runs-on : ubuntu-latest
17
+ outputs :
18
+ is_core_team : ${{ steps.check_if_actor_is_maintainer.outputs.result }}
14
19
steps :
15
20
- uses : actions/checkout@v4
16
21
- name : Check if actor is maintainer
17
- id : check_maintainer
22
+ id : check_if_actor_is_maintainer
18
23
uses : actions/github-script@v7
19
24
with :
20
25
script : |
28
33
}
29
34
console.log(`🔴 ${actor} is NOT a maintainer`);
30
35
return null;
31
- - name : Label PR as React Core Team
32
- if : ${{ steps.check_maintainer.outputs.result }}
33
- uses : actions/github-script@v7
34
- with :
35
- script : |
36
- github.rest.issues.addLabels({
37
- owner: context.repo.owner,
38
- repo: context.repo.repo,
39
- issue_number: ${{ github.event.number }},
40
- labels: ['React Core Team']
41
- });
Original file line number Diff line number Diff line change
1
+ name : (Shared) Label Core Team PRs
2
+
3
+ on :
4
+ pull_request :
5
+
6
+ env :
7
+ TZ : /usr/share/zoneinfo/America/Los_Angeles
8
+ # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
9
+ SEGMENT_DOWNLOAD_TIMEOUT_MINS : 1
10
+
11
+ jobs :
12
+ check_maintainer :
13
+ uses : facebook/react/.github/workflows/shared_check_maintainer.yml@main
14
+
15
+ label :
16
+ if : ${{ needs.check_maintainer.outputs.is_core_team }}
17
+ runs-on : ubuntu-latest
18
+ needs : check_maintainer
19
+ steps :
20
+ - name : Label PR as React Core Team
21
+ uses : actions/github-script@v7
22
+ with :
23
+ script : |
24
+ github.rest.issues.addLabels({
25
+ owner: context.repo.owner,
26
+ repo: context.repo.repo,
27
+ issue_number: ${{ github.event.number }},
28
+ labels: ['React Core Team']
29
+ });
You can’t perform that action at this time.
0 commit comments