Skip to content

Commit 5f4be21

Browse files
committed
ci: grant pull-requests: read where paths-filter needs it
Declaring a `permissions:` block sets every unlisted scope to none, which dropped `pull-requests` for the six workflows whose file-changes job runs dorny/paths-filter. That action defaults to `token: ${{ github.token }}` and reads the PR's changed-file list via pulls.listFiles on pull_request events, so it needs pull-requests: read. test.yml also passes `list-files: shell`, which depends on that list directly. Applied to exactly the six paths-filter users: bench, cleanliness, convergence, coverage, fp-stability, test. The other nine workflows reference no GitHub API beyond contents and stay at contents: read. Claude-Session: https://claude.ai/code/session_01XPqfEaUBG7ZaZVzeMWnKHd
1 parent a473e0c commit 5f4be21

6 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/bench.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
# Least-privilege default: no job in this workflow writes to the repo.
14+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
15+
# changed-file list through the API on pull_request events.
1416
permissions:
1517
contents: read
18+
pull-requests: read
1619

1720
jobs:
1821
file-changes:

.github/workflows/cleanliness.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
# Least-privilege default: no job in this workflow writes to the repo.
14+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
15+
# changed-file list through the API on pull_request events.
1416
permissions:
1517
contents: read
18+
pull-requests: read
1619

1720
jobs:
1821
file-changes:

.github/workflows/convergence.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ env:
1111
OMPI_MCA_rmaps_base_oversubscribe: 1
1212

1313
# Least-privilege default: no job in this workflow writes to the repo.
14+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
15+
# changed-file list through the API on pull_request events.
1416
permissions:
1517
contents: read
18+
pull-requests: read
1619

1720
jobs:
1821
file-changes:

.github/workflows/coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
# Least-privilege default: no job in this workflow writes to the repo.
15+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
16+
# changed-file list through the API on pull_request events.
1517
permissions:
1618
contents: read
19+
pull-requests: read
1720

1821
jobs:
1922
file-changes:

.github/workflows/fp-stability.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ on:
3636
workflow_dispatch:
3737

3838
# Least-privilege default: no job in this workflow writes to the repo.
39+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
40+
# changed-file list through the API on pull_request events.
3941
permissions:
4042
contents: read
43+
pull-requests: read
4144

4245
jobs:
4346
file-changes:

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ concurrency:
1313
cancel-in-progress: ${{ github.event_name != 'push' }}
1414

1515
# Least-privilege default: no job in this workflow writes to the repo.
16+
# pull-requests: read is required by dorny/paths-filter, which reads the PR's
17+
# changed-file list through the API on pull_request events.
1618
permissions:
1719
contents: read
20+
pull-requests: read
1821

1922
jobs:
2023
lint-gate:

0 commit comments

Comments
 (0)