chore(sec): remove not needed permissions (#1442)

this PR removes a few permissions in CI where I don't think they are
needed
This commit is contained in:
Frank Elsinga
2025-10-10 15:40:03 +02:00
committed by GitHub
parent 13ce1039ee
commit 8cd5e28f3a
4 changed files with 23 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ permissions: write-all
jobs: jobs:
dependabot: dependabot:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }} if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps: steps:
- name: Dependabot metadata - name: Dependabot metadata
id: metadata id: metadata

View File

@@ -11,7 +11,8 @@ jobs:
build-node: build-node:
name: "build on ${{ matrix.os }}" name: "build on ${{ matrix.os }}"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions:
contents: read
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
strategy: strategy:
@@ -21,6 +22,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: { persist-credentials: false }
- uses: actions/setup-node@v5 - uses: actions/setup-node@v5
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
@@ -34,10 +36,13 @@ jobs:
build-artifacts: build-artifacts:
name: "build artifacts" name: "build artifacts"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: { persist-credentials: false }
- uses: actions/setup-node@v5 - uses: actions/setup-node@v5
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
@@ -81,9 +86,12 @@ jobs:
unit-tests: unit-tests:
name: "Unit tests" name: "Unit tests"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
with: { persist-credentials: false }
- run: npm ci - run: npm ci
- run: npm run test-unit-ci - run: npm run test-unit-ci
- name: Upload coverage reports to Codecov - name: Upload coverage reports to Codecov
@@ -96,9 +104,12 @@ jobs:
name: "E2E tests using chrome" name: "E2E tests using chrome"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
with: { persist-credentials: false }
- run: npm ci - run: npm ci
- name: Cypress run - name: Cypress run
uses: cypress-io/github-action@v6 uses: cypress-io/github-action@v6
@@ -119,6 +130,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
with: { persist-credentials: false }
- run: npm ci - run: npm ci
- name: Cypress run - name: Cypress run
uses: cypress-io/github-action@v6 uses: cypress-io/github-action@v6

View File

@@ -8,9 +8,12 @@ jobs:
deploy-pages: deploy-pages:
name: deploy/pages name: deploy/pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ github.event_name == 'push' }} if: ${{ github.event_name == 'push' }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: { persist-credentials: false }
- name: Use Node.js from nvmrc - name: Use Node.js from nvmrc
uses: actions/setup-node@v5 uses: actions/setup-node@v5
@@ -33,9 +36,10 @@ jobs:
deploy-docker: deploy-docker:
name: deploy/docker name: deploy/docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }} if: ${{ github.event_name == 'push' }}
permissions:
contents: read
packages: write
strategy: strategy:
fail-fast: false fail-fast: false

View File

@@ -12,11 +12,14 @@ jobs:
defaults: defaults:
run: run:
shell: bash shell: bash
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0
ref: main ref: main
persist-credentials: false
- name: Use Node.js from nvmrc - name: Use Node.js from nvmrc
uses: actions/setup-node@v5 uses: actions/setup-node@v5