Skip to content

Commit ab693a9

Browse files
authored
[ci] Scope permissions for all workflows (facebook#32704)
1 parent 607615f commit ab693a9

23 files changed

+55
-3
lines changed

.github/workflows/compiler_discord_notify.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- compiler/**
88
- .github/workflows/compiler_**.yml
99

10+
permissions: {}
11+
1012
jobs:
1113
check_maintainer:
1214
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main

.github/workflows/compiler_playground.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- compiler/**
99
- .github/workflows/compiler_playground.yml
1010

11+
permissions: {}
12+
1113
concurrency:
1214
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
1315
cancel-in-progress: true

.github/workflows/compiler_prereleases.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ on:
2020
NPM_TOKEN:
2121
required: true
2222

23+
permissions: {}
24+
2325
env:
2426
TZ: /usr/share/zoneinfo/America/Los_Angeles
2527
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
2628
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
27-
GH_TOKEN: ${{ github.token }}
2829
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2930

3031
defaults:

.github/workflows/compiler_prereleases_manual.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
required: true
1616
type: string
1717

18+
permissions: {}
19+
1820
env:
1921
TZ: /usr/share/zoneinfo/America/Los_Angeles
2022

.github/workflows/compiler_prereleases_nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
# At 10 minutes past 16:00 on Mon, Tue, Wed, Thu, and Fri
66
- cron: 10 16 * * 1,2,3,4,5
77

8+
permissions: {}
9+
810
env:
911
TZ: /usr/share/zoneinfo/America/Los_Angeles
1012

.github/workflows/compiler_prereleases_weekly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
# At 10 minutes past 9:00 on Mon
66
- cron: 10 9 * * 1
77

8+
permissions: {}
9+
810
env:
911
TZ: /usr/share/zoneinfo/America/Los_Angeles
1012

.github/workflows/compiler_typescript.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- compiler/**
99
- .github/workflows/compiler_typescript.yml
1010

11+
permissions: {}
12+
1113
concurrency:
1214
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
1315
cancel-in-progress: true

.github/workflows/devtools_regression_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
required: false
1010
type: string
1111

12+
permissions: {}
13+
1214
env:
1315
TZ: /usr/share/zoneinfo/America/Los_Angeles
1416
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
@@ -18,6 +20,9 @@ jobs:
1820
download_build:
1921
name: Download base build
2022
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
2126
steps:
2227
- uses: actions/checkout@v4
2328
- uses: actions/setup-node@v4

.github/workflows/runtime_build_and_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
paths-ignore:
88
- compiler/**
99

10+
permissions: {}
11+
1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }}
1214
cancel-in-progress: true
@@ -768,6 +770,9 @@ jobs:
768770
if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
769771
name: Run sizebot
770772
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
771776
runs-on: ubuntu-latest
772777
steps:
773778
- uses: actions/checkout@v4

.github/workflows/runtime_discord_notify.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- compiler/**
88
- .github/workflows/compiler_**.yml
99

10+
permissions: {}
11+
1012
jobs:
1113
check_maintainer:
1214
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main

0 commit comments

Comments
 (0)