From 171fed0d178375491bbfccf67cb7625d9247c257 Mon Sep 17 00:00:00 2001 From: Sashank Bhamidi Date: Fri, 20 Nov 2026 11:19:30 +0530 Subject: [PATCH] lock down workflow token permissions --- .github/workflows/documentation.yml | 2 ++ .github/workflows/ruff.yml | 2 ++ .github/workflows/tests.yml | 2 ++ news/+deploy-github-release-write.internal | 1 + news/+workflow-permissions.internal | 1 + 5 files changed, 8 insertions(+) create mode 100644 news/+deploy-github-release-write.internal create mode 100644 news/+workflow-permissions.internal diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9c99f668e..0689044bf 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,6 @@ name: Check news fragments filenames, build documentation, check links, spelling, grammar, and style +permissions: + contents: read on: push: branches: diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index f2c775959..fde974959 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,4 +1,6 @@ name: Check code style with ruff +permissions: + contents: read on: [push, pull_request] jobs: ruff: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e277d7046..436662b15 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,6 @@ name: tests +permissions: + contents: read on: push: diff --git a/news/+deploy-github-release-write.internal b/news/+deploy-github-release-write.internal new file mode 100644 index 000000000..c0d32846d --- /dev/null +++ b/news/+deploy-github-release-write.internal @@ -0,0 +1 @@ +Added ``contents: write`` to ``deploy-github-release`` so it can create GitHub releases. Shipped in 778ca8c2 during the v8.0.0a1 release. @SashankBhamidi diff --git a/news/+workflow-permissions.internal b/news/+workflow-permissions.internal new file mode 100644 index 000000000..ccb4ad3f2 --- /dev/null +++ b/news/+workflow-permissions.internal @@ -0,0 +1 @@ +Declared ``contents: read`` for the documentation, ruff, and tests workflows. @SashankBhamidi