Skip to content

Commit 4ad78b8

Browse files
committed
ci: declare workflow-level contents: read on the 9 python-N.yml build workflows
Pins the default GITHUB_TOKEN to contents: read on the per-Python- version build workflows. Each one runs sphinx-build / msgfmt against the translated rst files and uploads the rendered HTML as a workflow artifact - no GitHub API mutation. - python-37.yml, python-38.yml, python-39.yml, python-310.yml, python-311.yml, python-312.yml, python-313.yml, python-314.yml, python-315.yml update-tx-config.yml is intentionally left implicit; it commits and pushes via GITHUB_TOKEN, so the scope is best declared by the maintainer who owns the translation-sync flow. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
1 parent 0070041 commit 4ad78b8

9 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/python-310.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "22 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-311.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "32 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-312.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "42 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-313.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "52 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-314.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "2 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-315.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: "12 * * * *"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
sync:
1316
uses: ./.github/workflows/sync.yml

.github/workflows/python-37.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: python-37
22

33
on: workflow_dispatch
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
sync:
710
uses: ./.github/workflows/sync.yml

.github/workflows/python-38.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: python-38
22

33
on: workflow_dispatch
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
sync:
710
uses: ./.github/workflows/sync.yml

.github/workflows/python-39.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: python-39
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
sync:
811
uses: ./.github/workflows/sync.yml

0 commit comments

Comments
 (0)