Skip to content

Commit 8cd5e28

Browse files
chore(sec): remove not needed permissions (#1442)
this PR removes a few permissions in CI where I don't think they are needed
1 parent 13ce103 commit 8cd5e28

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

.github/workflows/auto-merge-dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions: write-all
77
jobs:
88
dependabot:
99
runs-on: ubuntu-latest
10-
if: ${{ github.actor == 'dependabot[bot]' }}
10+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
1111
steps:
1212
- name: Dependabot metadata
1313
id: metadata

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
build-node:
1212
name: "build on ${{ matrix.os }}"
1313
runs-on: ${{ matrix.os }}
14-
14+
permissions:
15+
contents: read
1516
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
1617

1718
strategy:
@@ -21,6 +22,7 @@ jobs:
2122

2223
steps:
2324
- uses: actions/checkout@v5
25+
with: { persist-credentials: false }
2426
- uses: actions/setup-node@v5
2527
with:
2628
node-version-file: '.nvmrc'
@@ -34,10 +36,13 @@ jobs:
3436
build-artifacts:
3537
name: "build artifacts"
3638
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
3741
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
3842

3943
steps:
4044
- uses: actions/checkout@v5
45+
with: { persist-credentials: false }
4146
- uses: actions/setup-node@v5
4247
with:
4348
node-version-file: '.nvmrc'
@@ -81,9 +86,12 @@ jobs:
8186
unit-tests:
8287
name: "Unit tests"
8388
runs-on: ubuntu-latest
89+
permissions:
90+
contents: read
8491
steps:
8592
- name: Checkout
8693
uses: actions/checkout@v5
94+
with: { persist-credentials: false }
8795
- run: npm ci
8896
- run: npm run test-unit-ci
8997
- name: Upload coverage reports to Codecov
@@ -96,9 +104,12 @@ jobs:
96104
name: "E2E tests using chrome"
97105

98106
runs-on: ubuntu-latest
107+
permissions:
108+
contents: read
99109
steps:
100110
- name: Checkout
101111
uses: actions/checkout@v5
112+
with: { persist-credentials: false }
102113
- run: npm ci
103114
- name: Cypress run
104115
uses: cypress-io/github-action@v6
@@ -119,6 +130,7 @@ jobs:
119130
steps:
120131
- name: Checkout
121132
uses: actions/checkout@v5
133+
with: { persist-credentials: false }
122134
- run: npm ci
123135
- name: Cypress run
124136
uses: cypress-io/github-action@v6

.github/workflows/deploy.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ jobs:
88
deploy-pages:
99
name: deploy/pages
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113
if: ${{ github.event_name == 'push' }}
1214
steps:
1315
- uses: actions/checkout@v5
16+
with: { persist-credentials: false }
1417

1518
- name: Use Node.js from nvmrc
1619
uses: actions/setup-node@v5
@@ -33,9 +36,10 @@ jobs:
3336
deploy-docker:
3437
name: deploy/docker
3538
runs-on: ubuntu-latest
36-
3739
if: ${{ github.event_name == 'push' }}
38-
40+
permissions:
41+
contents: read
42+
packages: write
3943
strategy:
4044
fail-fast: false
4145

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ jobs:
1212
defaults:
1313
run:
1414
shell: bash
15+
permissions:
16+
contents: read
1517
steps:
1618
- uses: actions/checkout@v5
1719
with:
1820
fetch-depth: 0
1921
ref: main
22+
persist-credentials: false
2023

2124
- name: Use Node.js from nvmrc
2225
uses: actions/setup-node@v5

0 commit comments

Comments
 (0)