Skip to content

Commit c8fdf60

Browse files
authored
CI: Improve permissions. (#33466)
1 parent b2f1c92 commit c8fdf60

5 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
test:
1515
name: Lint, Unit, Unit addons, Circular dependencies & Examples testing
1616
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1719
steps:
1820
- name: Git checkout
1921
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -41,6 +43,8 @@ jobs:
4143
name: E2E testing
4244
runs-on: ${{ matrix.os }}
4345
timeout-minutes: 30
46+
permissions:
47+
contents: read
4448
strategy:
4549
fail-fast: false
4650
matrix:

.github/workflows/codeql-code-scanning.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- cron: '29 23 * * 0'
1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
analyze:
1518
name: Analyze

.github/workflows/protected-folders.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- 'build/**'
77
- 'docs/**'
88

9-
permissions:
10-
contents: read
9+
permissions: {}
1110

1211
jobs:
1312
check:
1413
runs-on: ubuntu-latest
14+
permissions: {}
1515
steps:
1616
- name: Check for protected folder changes
1717
if: ${{ github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'COLLABORATOR' }}

.github/workflows/read-size.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
read-size:
1919
name: Tree-shaking
2020
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
2123
steps:
2224
- name: Git checkout
2325
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

.github/workflows/report-size.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ on:
66
types:
77
- completed
88

9-
# This workflow needs to be run with "pull-requests: write" permissions to
10-
# be able to comment on the pull request. We can't checkout the PR code
11-
# in this workflow.
12-
# Reference:
13-
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
149
permissions:
15-
pull-requests: write
10+
contents: read
1611

1712
jobs:
1813
report-size:
1914
name: Comment on PR
2015
runs-on: ubuntu-latest
16+
# This job needs "pull-requests: write" permissions to be able to comment
17+
# on the pull request. We can't checkout the PR code in this workflow.
18+
# Reference:
19+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
20+
permissions:
21+
contents: read
22+
pull-requests: write
2123
if: github.event.workflow_run.event == 'pull_request' &&
2224
github.event.workflow_run.conclusion == 'success'
2325
steps:

0 commit comments

Comments
 (0)