From aa36144e72a6e7611c148f83b2b9620c2ca7f16c Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Wed, 4 Mar 2026 15:06:00 +0000 Subject: [PATCH] Restrict GITHUB_TOKEN permissions in workflows Ensure workflows have the minimum required permissions and silence the security alerts --- .github/workflows/build_and_publish.yml | 6 ++++++ .github/workflows/main.yml | 3 +++ .github/workflows/update-dependencies.yml | 3 +++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index c33dc0b..98d8ff8 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -16,6 +16,8 @@ env: jobs: tag-new-version: + permissions: + contents: write name: Tag new version runs-on: ubuntu-24.04 outputs: @@ -31,6 +33,10 @@ jobs: create_annotated_tag: true build-and-publish-docker-image: + permissions: + packages: write + contents: read + name: Build and publish Docker image runs-on: ubuntu-24.04 needs: tag-new-version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6eb867..9a9a171 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ name: CI on: push: +permissions: + contents: read + jobs: check: runs-on: ubuntu-24.04 diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index c294780..feed356 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -5,6 +5,9 @@ on: schedule: - cron: "0 4 * * WED" +permissions: + contents: read + jobs: update-dependencies: runs-on: ubuntu-24.04