From 9894ef761d6760bc25c2cda99b2e33c40c9af8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Felleg?= Date: Thu, 8 Oct 2026 13:43:10 +0200 Subject: [PATCH] build: apply least privilege to workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AndrĂ¡s Felleg --- .github/workflows/build.yaml | 9 +++++++++ .github/workflows/publish.yaml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1f81bd6..a98d3d1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,11 +13,15 @@ on: workflow_dispatch: # Allow workflow to be triggered manually. +permissions: {} + jobs: detect-secrets: if: "!contains(github.event.head_commit.message, '[skip ci]')" name: detect-secrets runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout repository @@ -42,6 +46,8 @@ jobs: needs: detect-secrets runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] @@ -63,6 +69,7 @@ jobs: runs-on: ubuntu-latest name: Final Test Results needs: [build] + permissions: {} steps: - run: | result="${{ needs.build.result }}" @@ -78,6 +85,8 @@ jobs: needs: build if: "github.ref_name == 'main' && github.event_name != 'pull_request'" runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout repository diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c4e5207..62958c9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -10,10 +10,14 @@ on: workflow_dispatch: # Allow this workflow to be triggered manually +permissions: {} + jobs: publish: name: publish-pypi runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout repository