@samitouri / QOS-React / commits / ab693a926f

[ci] Scope permissions for all workflows (#32704)

lauren committed Mar 21, 2025 at 14:40 UTC ab693a926f13cc2c4c4a3ab19d5405471f87236b
23 files changed +55 -3
.github/workflows/compiler_discord_notify.yml
+2
@@ -7,6 +7,8 @@ on:
7 - compiler/**
8 - .github/workflows/compiler_**.yml
9
10 +permissions: {}
11 +
12 jobs:
13 check_maintainer:
14 uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
.github/workflows/compiler_playground.yml
+2
@@ -8,6 +8,8 @@ on:
8 - compiler/**
9 - .github/workflows/compiler_playground.yml
10
11 +permissions: {}
12 +
13 concurrency:
14 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
15 cancel-in-progress: true
.github/workflows/compiler_prereleases.yml
+2 -1
@@ -20,11 +20,12 @@ on:
20 NPM_TOKEN:
21 required: true
22
23 +permissions: {}
24 +
25 env:
26 TZ: /usr/share/zoneinfo/America/Los_Angeles
27 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
28 SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
27 - GH_TOKEN: ${{ github.token }}
29 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30
31 defaults:
.github/workflows/compiler_prereleases_manual.yml
+2
@@ -15,6 +15,8 @@ on:
15 required: true
16 type: string
17
18 +permissions: {}
19 +
20 env:
21 TZ: /usr/share/zoneinfo/America/Los_Angeles
22
.github/workflows/compiler_prereleases_nightly.yml
+2
@@ -5,6 +5,8 @@ on:
5 # At 10 minutes past 16:00 on Mon, Tue, Wed, Thu, and Fri
6 - cron: 10 16 * * 1,2,3,4,5
7
8 +permissions: {}
9 +
10 env:
11 TZ: /usr/share/zoneinfo/America/Los_Angeles
12
.github/workflows/compiler_prereleases_weekly.yml
+2
@@ -5,6 +5,8 @@ on:
5 # At 10 minutes past 9:00 on Mon
6 - cron: 10 9 * * 1
7
8 +permissions: {}
9 +
10 env:
11 TZ: /usr/share/zoneinfo/America/Los_Angeles
12
.github/workflows/compiler_typescript.yml
+2
@@ -8,6 +8,8 @@ on:
8 - compiler/**
9 - .github/workflows/compiler_typescript.yml
10
11 +permissions: {}
12 +
13 concurrency:
14 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
15 cancel-in-progress: true
.github/workflows/devtools_regression_tests.yml
+5
@@ -9,6 +9,8 @@ on:
9 required: false
10 type: string
11
12 +permissions: {}
13 +
14 env:
15 TZ: /usr/share/zoneinfo/America/Los_Angeles
16 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
@@ -18,6 +20,9 @@ jobs:
20 download_build:
21 name: Download base build
22 runs-on: ubuntu-latest
23 + permissions:
24 + # We use github.token to download the build artifact from a previous runtime_build_and_test.yml run
25 + actions: read
26 steps:
27 - uses: actions/checkout@v4
28 - uses: actions/setup-node@v4
.github/workflows/runtime_build_and_test.yml
+5
@@ -7,6 +7,8 @@ on:
7 paths-ignore:
8 - compiler/**
9
10 +permissions: {}
11 +
12 concurrency:
13 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
14 cancel-in-progress: true
@@ -768,6 +770,9 @@ jobs:
770 if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
771 name: Run sizebot
772 needs: [build_and_lint]
773 + permissions:
774 + # We use github.token to download the build artifact from a previous runtime_build_and_test.yml run
775 + actions: read
776 runs-on: ubuntu-latest
777 steps:
778 - uses: actions/checkout@v4
.github/workflows/runtime_discord_notify.yml
+2
@@ -7,6 +7,8 @@ on:
7 - compiler/**
8 - .github/workflows/compiler_**.yml
9
10 +permissions: {}
11 +
12 jobs:
13 check_maintainer:
14 uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
.github/workflows/runtime_eslint_plugin_e2e.yml
+2
@@ -7,6 +7,8 @@ on:
7 paths-ignore:
8 - compiler/**
9
10 +permissions: {}
11 +
12 concurrency:
13 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
14 cancel-in-progress: true
.github/workflows/runtime_fuzz_tests.yml
+2
@@ -8,6 +8,8 @@ on:
8 - main
9 workflow_dispatch:
10
11 +permissions: {}
12 +
13 env:
14 TZ: /usr/share/zoneinfo/America/Los_Angeles
15
.github/workflows/runtime_prereleases.yml
+2 -1
@@ -17,11 +17,12 @@ on:
17 NPM_TOKEN:
18 required: true
19
20 +permissions: {}
21 +
22 env:
23 TZ: /usr/share/zoneinfo/America/Los_Angeles
24 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
25 SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
24 - GH_TOKEN: ${{ github.token }}
26 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27
28 jobs:
.github/workflows/runtime_prereleases_manual.yml
+2
@@ -6,6 +6,8 @@ on:
6 prerelease_commit_sha:
7 required: true
8
9 +permissions: {}
10 +
11 env:
12 TZ: /usr/share/zoneinfo/America/Los_Angeles
13
.github/workflows/runtime_prereleases_nightly.yml
+2
@@ -5,6 +5,8 @@ on:
5 # At 10 minutes past 16:00 on Mon, Tue, Wed, Thu, and Fri
6 - cron: 10 16 * * 1,2,3,4,5
7
8 +permissions: {}
9 +
10 env:
11 TZ: /usr/share/zoneinfo/America/Los_Angeles
12
.github/workflows/runtime_releases_from_npm_manual.yml
+2 -1
@@ -31,11 +31,12 @@ on:
31 type: boolean
32 default: false
33
34 +permissions: {}
35 +
36 env:
37 TZ: /usr/share/zoneinfo/America/Los_Angeles
38 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
39 SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
38 - GH_TOKEN: ${{ github.token }}
40 NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41
42 jobs:
.github/workflows/shared_check_maintainer.yml
+5
@@ -14,6 +14,8 @@ on:
14 is_core_team:
15 value: ${{ jobs.check_maintainer.outputs.is_core_team }}
16
17 +permissions: {}
18 +
19 env:
20 TZ: /usr/share/zoneinfo/America/Los_Angeles
21 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
@@ -22,6 +24,9 @@ env:
24 jobs:
25 check_maintainer:
26 runs-on: ubuntu-latest
27 + permissions:
28 + # We fetch the contents of the MAINTAINERS file
29 + contents: read
30 outputs:
31 is_core_team: ${{ steps.check_if_actor_is_maintainer.outputs.result }}
32 steps:
.github/workflows/shared_cleanup_merged_branch_caches.yml
+2
@@ -11,6 +11,8 @@ on:
11 required: true
12 type: string
13
14 +permissions: {}
15 +
16 jobs:
17 cleanup:
18 runs-on: ubuntu-latest
.github/workflows/shared_cleanup_stale_branch_caches.yml
+2
@@ -6,6 +6,8 @@ on:
6 - cron: 0 0 * * *
7 workflow_dispatch:
8
9 +permissions: {}
10 +
11 jobs:
12 cleanup:
13 runs-on: ubuntu-latest
.github/workflows/shared_close_direct_sync_branch_prs.yml
+2
@@ -5,6 +5,8 @@ on:
5 branches:
6 - 'builds/facebook-**'
7
8 +permissions: {}
9 +
10 env:
11 TZ: /usr/share/zoneinfo/America/Los_Angeles
12 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
.github/workflows/shared_label_core_team_prs.yml
+2
@@ -3,6 +3,8 @@ name: (Shared) Label Core Team PRs
3 on:
4 pull_request_target:
5
6 +permissions: {}
7 +
8 env:
9 TZ: /usr/share/zoneinfo/America/Los_Angeles
10 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
.github/workflows/shared_lint.yml
+2
@@ -5,6 +5,8 @@ on:
5 branches: [main]
6 pull_request:
7
8 +permissions: {}
9 +
10 concurrency:
11 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
12 cancel-in-progress: true
.github/workflows/shared_stale.yml
+2
@@ -6,6 +6,8 @@ on:
6 - cron: '0 * * * *'
7 workflow_dispatch:
8
9 +permissions: {}
10 +
11 env:
12 TZ: /usr/share/zoneinfo/America/Los_Angeles
13