Skip to content

Commit 5a8c3ad

Browse files
ci: set minimal permissions to workflows (#7070)
* ci: set minimal permissions to workflows Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com> * Fix trailing whitespace on playwright-update.yml Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> --------- Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com> Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
1 parent e43da4a commit 5a8c3ad

File tree

11 files changed

+29
-7
lines changed

11 files changed

+29
-7
lines changed

.github/workflows/auto_author_assign.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
types: [opened, reopened]
77

88
permissions:
9-
pull-requests: write
9+
contents: read
1010

1111
jobs:
1212
assign-author:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write
1416
steps:
1517
- uses: toshimaru/auto-author-assign@v1.6.2

.github/workflows/binder.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request_target:
44
types: [opened]
55

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

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- cron: '0 0 * * *'
99

1010
permissions:
11-
contents: write
11+
contents: read
1212

1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

.github/workflows/buildutils.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
versioning:
1821
runs-on: ubuntu-latest

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66

77
permissions:
8-
contents: write
8+
contents: read
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

.github/workflows/enforce-label.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Enforce PR label
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
types: [labeled, unlabeled, opened, edited, synchronize]

.github/workflows/lock.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
- cron: '0 0 * * *'
66

77
permissions:
8-
issues: write
9-
pull-requests: write
8+
contents: read
109

1110
jobs:
1211
lock:
1312
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
pull-requests: write
1416
steps:
1517
- uses: dessant/lock-threads@v4
1618
with:

.github/workflows/playwright-update.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
types: [created, edited]
66

77
permissions:
8-
contents: write
9-
pull-requests: write
8+
contents: read
109

1110
jobs:
1211
update-snapshots:
1312
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'update playwright snapshots') }}
1413
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write # Required by actions/update-snapshots
1516
strategy:
1617
fail-fast: false
1718
matrix:

.github/workflows/prep-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
description: 'Use PRs with activity since the last stable git tag'
2020
required: false
2121
type: boolean
22+
permissions:
23+
contents: read
2224
jobs:
2325
prep_release:
2426
runs-on: ubuntu-latest

.github/workflows/publish-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
description: 'Comma separated list of steps to skip'
1313
required: false
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
publish_release:
1720
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)