Explicitly specify permissions needed by workflows

This reduces the default permissions for these workflows, see
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
This commit is contained in:
Marcono1234 2024-03-13 00:27:52 +01:00
parent 6721fc9fa7
commit 537945ac18
5 changed files with 21 additions and 4 deletions

View File

@ -8,6 +8,9 @@ on:
paths:
- 'action/index.js'
permissions:
contents: read
jobs:
check-no-dist-update:
name: Check no dist update

View File

@ -6,6 +6,9 @@ on: # rebuild any PRs and main branch changes
- main
- 'releases/*'
permissions:
contents: read
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest

View File

@ -9,6 +9,11 @@ on:
schedule:
- cron: '24 4 * * 6'
permissions:
contents: read
# Allow uploading CodeQL results
security-events: write
jobs:
analyze:
name: Analyze

View File

@ -7,6 +7,12 @@ on:
# Support running workflow manually
workflow_dispatch:
permissions:
# Allow creation of branch for checksums file update
contents: write
# Allow creation of pull request
pull-requests: write
jobs:
update-checksums:
name: Update checksums

View File

@ -4,14 +4,14 @@ on:
branches:
- main
permissions:
# Allow the workflow to push the changed file to the repository
contents: write
jobs:
update-dist:
runs-on: ubuntu-latest
permissions:
# Allow the job to push the changed file to the repository
contents: write
steps:
- uses: actions/checkout@v4