Skip to content

Commit da8dfbf

Browse files
authored
Set minimal workflow permissions (#53297)
1 parent c797bd2 commit da8dfbf

15 files changed

+63
-0
lines changed

.github/workflows/accept-baselines-fix-lints.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Accept Baselines and Fix Lints
33
on:
44
workflow_dispatch: {}
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
build:
811
runs-on: ubuntu-latest
912

13+
permissions:
14+
contents: write
15+
1016
steps:
1117
- uses: actions/checkout@v3
1218
- uses: actions/setup-node@v3

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
- release-*
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
1518
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
# * * * * *
2222
- cron: '30 1 * * 0'
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
CodeQL-Build:
2629
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest

.github/workflows/ensure-related-repos-run-crons.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- cron: '0 0 1 * *'
1212
workflow_dispatch: {}
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
build:
1619
runs-on: ubuntu-latest

.github/workflows/error-deltas-watchdog.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
schedule:
66
- cron: '0 0 * * 3' # Every Wednesday
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
check-for-recent:
1013
runs-on: ubuntu-latest

.github/workflows/new-release-branch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
repository_dispatch:
55
types: new-release-branch
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
runs-on: ubuntu-latest
1013

14+
permissions:
15+
contents: write
16+
1117
steps:
1218
- uses: actions/setup-node@v3
1319
- run: |

.github/workflows/nightly.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
repository_dispatch:
99
types: publish-nightly
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest

.github/workflows/release-branch-artifact.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- release-*
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest

.github/workflows/rich-navigation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
- release-*
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
richnav:
1518
runs-on: windows-latest

.github/workflows/set-version.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
repository_dispatch:
55
types: set-version
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
runs-on: ubuntu-latest
1013

14+
permissions:
15+
contents: write
16+
1117
steps:
1218
- uses: actions/setup-node@v3
1319
- uses: actions/checkout@v3

.github/workflows/sync-branch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ on:
99
description: 'Target Branch Name'
1010
required: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build:
1417
runs-on: ubuntu-latest
1518

19+
permissions:
20+
contents: write
21+
1622
steps:
1723
- uses: actions/setup-node@v3
1824
- uses: actions/checkout@v3

.github/workflows/sync-wiki.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Sync Two Uncyclo Repos
22

33
on: [gollum]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
sync:
710
runs-on: ubuntu-latest

.github/workflows/twoslash-repros.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
required: false
2020
type: string
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
run:
2427
if: ${{ github.repository == 'microsoft/TypeScript' }}

.github/workflows/update-lkg.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Update LKG
33
on:
44
workflow_dispatch: {}
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
build:
811
runs-on: ubuntu-latest
912

13+
permissions:
14+
contents: write
15+
1016
steps:
1117
- uses: actions/checkout@v3
1218
- uses: actions/setup-node@v3

.github/workflows/update-package-lock.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ on:
77
- cron: '0 6 * * *'
88
workflow_dispatch: {}
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
1316
if: github.repository == 'microsoft/TypeScript'
1417

18+
permissions:
19+
contents: write
20+
1521
steps:
1622
- uses: actions/checkout@v3
1723
with:

0 commit comments

Comments
 (0)