Skip to content

Commit e71d420

Browse files
authored
[ci] Don't run some checks for non-members/collaborators (#32918)
There's really no need to even run the workflow for non-members or collaborators for the labeling and discord notification workflows. We can exit early.
1 parent 2ed34eb commit e71d420

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.github/workflows/compiler_discord_notify.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ on:
1010
permissions: {}
1111

1212
jobs:
13+
check_access:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is_member_or_collaborator: ${{ steps.check_access.outputs.result }}
17+
steps:
18+
- name: Check access
19+
id: check_access
20+
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
21+
run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT"
22+
1323
check_maintainer:
24+
if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
25+
needs: [check_access]
1426
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
1527
permissions:
1628
# Used by check_maintainer

.github/workflows/runtime_discord_notify.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ on:
1010
permissions: {}
1111

1212
jobs:
13+
check_access:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is_member_or_collaborator: ${{ steps.check_access.outputs.result }}
17+
steps:
18+
- name: Check access
19+
id: check_access
20+
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
21+
run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT"
22+
1323
check_maintainer:
24+
if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
25+
needs: [check_access]
1426
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
1527
permissions:
1628
# Used by check_maintainer

.github/workflows/shared_label_core_team_prs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ env:
1111
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
1212

1313
jobs:
14+
check_access:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
is_member_or_collaborator: ${{ steps.check_access.outputs.result }}
18+
steps:
19+
- name: Check access
20+
id: check_access
21+
if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }}
22+
run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT"
23+
1424
check_maintainer:
25+
if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
26+
needs: [check_access]
1527
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
1628
permissions:
1729
# Used by check_maintainer

0 commit comments

Comments
 (0)