Skip to content

Commit 918f911

Browse files
authored
Add explicit permissions blocks to caller workflow files (#176)
## Summary Adds explicit `permissions:` blocks to the workflow files that call ITensorActions reusable workflows. Most of these files previously declared no `permissions:` block and inherited their `GITHUB_TOKEN` ceiling from the repository / organization Actions defaults. After this change, each workflow's permissions live in the YAML rather than in a settings page, and any future change to the org or per-repo Actions default can only narrow (never widen) what these workflows can do. Each block declares the minimum the workflow actually needs (`contents: read` for checkout-only workflows; elevated for Documentation gh-pages deploy, TagBot tag creation, IntegrationTest's gate job, and VersionCheck's PR-file lookup). Verified by temporarily flipping this repo's per-repo Actions setting to `default_workflow_permissions: read` and `can_approve_pull_request_reviews: false` — the planned org-default end state. All workflows pass.
1 parent 3c6df30 commit 918f911

7 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/CheckCompatBounds.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: "Check Compat Bounds"
22
on:
33
pull_request: ~
4+
permissions:
5+
contents: "read"
46
jobs:
57
check-compat-bounds:
68
name: "Check Compat Bounds"

.github/workflows/Documentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
concurrency:
1111
group: "${{ github.workflow }}-${{ github.ref }}"
1212
cancel-in-progress: "${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }}"
13+
permissions:
14+
contents: "write"
1315
jobs:
1416
build-and-deploy-docs:
1517
name: "Documentation"

.github/workflows/FormatCheck.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- "synchronize"
77
- "reopened"
88
- "ready_for_review"
9+
permissions:
10+
contents: "read"
911
jobs:
1012
format-check:
1113
name: "Format Check"

.github/workflows/IntegrationTest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "reopened"
1212
- "ready_for_review"
1313
- "converted_to_draft"
14+
permissions:
15+
actions: "read"
16+
contents: "read"
1417
jobs:
1518
integration-test:
1619
name: "IntegrationTest"

.github/workflows/TagBot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
workflow_dispatch: ~
77
env:
88
REGISTRY_TAGBOT_ACTION: "JuliaRegistries/TagBot"
9+
permissions:
10+
contents: "write"
11+
issues: "read"
912
jobs:
1013
TagBot:
1114
if: "github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'"

.github/workflows/Tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
concurrency:
2020
group: "${{ github.workflow }}-${{ github.ref }}"
2121
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
22+
permissions:
23+
contents: "read"
2224
jobs:
2325
tests:
2426
name: "Tests"

.github/workflows/VersionCheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Version Check"
22
on:
33
pull_request: ~
4+
permissions:
5+
contents: "read"
6+
pull-requests: "read"
47
jobs:
58
version-check:
69
name: "Version Check"

0 commit comments

Comments
 (0)