From e97c0d9ef3f0f311ee2c2c1045df2701bcf31167 Mon Sep 17 00:00:00 2001 From: Peter Matkovski Date: Wed, 8 Jul 2026 13:29:27 +0200 Subject: [PATCH 1/5] CI: add least-privilege permissions to GitHub Actions workflows Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba410d5c3..0d4306d87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,10 @@ on: - '.claude/**' - '.idea/**' +permissions: + contents: read + pull-requests: read + jobs: unit: uses: ./.github/workflows/run_tests.yml From 89ca6d2b3b677667e21e775422d321d416cfdc42 Mon Sep 17 00:00:00 2001 From: Peter Matkovski Date: Wed, 8 Jul 2026 13:29:28 +0200 Subject: [PATCH 2/5] CI: add least-privilege permissions to GitHub Actions workflows Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164 --- .github/workflows/daily.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 6cbf6bf23..9d75951a7 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,6 +5,9 @@ on: - cron: '0 3 * * *' workflow_dispatch: { } +permissions: + contents: read + jobs: integration: uses: ./.github/workflows/run_tests.yml From 3200ac125416326d1b6b0642865809ae98666852 Mon Sep 17 00:00:00 2001 From: Peter Matkovski Date: Wed, 8 Jul 2026 13:29:29 +0200 Subject: [PATCH 3/5] CI: add least-privilege permissions to GitHub Actions workflows Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164 --- .github/workflows/python-versions.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-versions.yml b/.github/workflows/python-versions.yml index 600f53629..fa3a16788 100644 --- a/.github/workflows/python-versions.yml +++ b/.github/workflows/python-versions.yml @@ -19,6 +19,10 @@ concurrency: group: python-compatibility-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: read + jobs: resolve: name: Resolve on Python ${{ matrix.python }} From 684401206cbc08dfd333306e17712fe701caf165 Mon Sep 17 00:00:00 2001 From: Peter Matkovski Date: Wed, 8 Jul 2026 13:29:30 +0200 Subject: [PATCH 4/5] CI: add least-privilege permissions to GitHub Actions workflows Add explicit workflow-level permissions blocks to resolve CodeQL actions/missing-workflow-permissions alerts. Scopes are derived from workflow operations (git push, artifact upload, Danger, release lanes). Refs: APPSEC-164 --- .github/workflows/run_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index e2ac653bb..a24234c70 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -24,6 +24,10 @@ env: # If set, uv will run without updating the uv.lock file. Equivalent to the `uv run --frozen`. UV_FROZEN: "1" +permissions: + actions: write + contents: read + jobs: # Run linters in one step to reduce checkout & dependencies setup overhead lint: From 8a18466ba7c34e212b113a8cbb6b9cb97b890e63 Mon Sep 17 00:00:00 2001 From: Peter Matkovski Date: Wed, 8 Jul 2026 16:10:24 +0200 Subject: [PATCH 5/5] Address CodeRabbit review feedback on workflow permissions. Scope actions: write to the lint job that saves the mypy cache, and grant actions: write on caller workflows so the reusable run_tests job can write caches. Co-authored-by: Cursor --- .github/workflows/ci.yml | 1 + .github/workflows/daily.yml | 1 + .github/workflows/run_tests.yml | 7 +++---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d4306d87..966040ec7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ on: - '.idea/**' permissions: + actions: write contents: read pull-requests: read diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 9d75951a7..b34c4f67d 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -6,6 +6,7 @@ on: workflow_dispatch: { } permissions: + actions: write contents: read jobs: diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index a24234c70..6fd9c52d3 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -24,15 +24,14 @@ env: # If set, uv will run without updating the uv.lock file. Equivalent to the `uv run --frozen`. UV_FROZEN: "1" -permissions: - actions: write - contents: read - jobs: # Run linters in one step to reduce checkout & dependencies setup overhead lint: name: Lint (ruff + mypy + validate pyproject.toml) runs-on: ubuntu-latest + permissions: + actions: write + contents: read steps: - name: Checkout uses: actions/checkout@v6