@samitouri / QOS-React-2 / commits / 1185f88d35

[ci] Only notify after labeling (#32103)

--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32103). * __->__ #32103 * #32102

lauren committed Jan 16, 2025 at 15:12 UTC 1185f88d35e83870aa220a30ddcec22ed7e8e362
3 files changed +2 -41
.github/workflows/compiler_discord_notify.yml
+1
@@ -2,6 +2,7 @@ name: (Compiler) Discord Notify
2
3 on:
4 pull_request_target:
5 + types: [labeled]
6 paths:
7 - compiler/**
8 - .github/workflows/compiler_**.yml
.github/workflows/runtime_discord_notify.yml
+1
@@ -2,6 +2,7 @@ name: (Runtime) Discord Notify
2
3 on:
4 pull_request_target:
5 + types: [labeled]
6 paths-ignore:
7 - compiler/**
8 - .github/workflows/compiler_**.yml
.github/workflows/shared_core_label.yml deleted
-41
@@ -1,41 +0,0 @@
1 -name: (Shared) Core Label
2 -
3 -on:
4 - pull_request_target:
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 - core_label:
13 - runs-on: ubuntu-latest
14 - steps:
15 - - uses: actions/checkout@v4
16 - - name: Check if actor is maintainer
17 - id: check_maintainer
18 - uses: actions/github-script@v7
19 - with:
20 - script: |
21 - const fs = require('fs');
22 - const actor = '${{ github.actor }}';
23 - const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
24 - const maintainers = new Set(data.split('\n'));
25 - if (maintainers.has(actor)) {
26 - console.log(`🟢 ${actor} is a maintainer`);
27 - return true;
28 - }
29 - console.log(`🔴 ${actor} is NOT a maintainer`);
30 - 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 - });