Skip to content

Commit 2e9f9b8

Browse files
tiranclaude
andcommitted
ci: add minimal permissions to GitHub Actions workflows
Add top-level `permissions: contents: read` to all three workflows (test, check, python-publish) to follow the GitHub security hardening recommendation of least-privilege token permissions. The publish workflow's existing job-level `id-token: write` override remains intact for trusted publishing. See: #1008 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 3072a0c commit 2e9f9b8

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/check.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
- push
55
- pull_request
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
pre-commit:
912
name: pre-commit

.github/workflows/python-publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ name: Upload Python Package
66
on:
77
- push
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build-n-publish:
1114
name: Build and publish Python distributions to PyPI
@@ -15,6 +18,7 @@ jobs:
1518
environment: release
1619

1720
permissions:
21+
contents: read
1822
# IMPORTANT: this permission is mandatory for trusted publishing
1923
id-token: write
2024

.github/workflows/test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ name: CI
44
on:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
unit:
912
name: unit

0 commit comments

Comments
 (0)