[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.
lauren committed
Apr 15, 2025 at 13:02 UTC
e71d4205aed6c41b88e3689c76b41da65f5c04c0
3 files changed
+36
.github/workflows/compiler_discord_notify.yml
+12
@@ -10,7 +10,19 @@ on:
10
permissions: {}
11
12
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
+
23
check_maintainer:
24
+ if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
25
+ needs: [check_access]
26
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
27
permissions:
28
# Used by check_maintainer
.github/workflows/runtime_discord_notify.yml
+12
@@ -10,7 +10,19 @@ on:
10
permissions: {}
11
12
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
+
23
check_maintainer:
24
+ if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
25
+ needs: [check_access]
26
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
27
permissions:
28
# Used by check_maintainer
.github/workflows/shared_label_core_team_prs.yml
+12
@@ -11,7 +11,19 @@ env:
11
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
12
13
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
+
24
check_maintainer:
25
+ if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' }}
26
+ needs: [check_access]
27
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
28
permissions:
29
# Used by check_maintainer