Skip to content

Commit e67d665

Browse files
committed
@
ci(nix): least-privilege the two nix workflows, symmetric path filters Review follow-ups, all three mechanical: - nix-check.yml declares `permissions: contents: read` instead of inheriting it. It was the only workflow in .github/workflows/ without a permissions block, and inheriting a repo-level setting is precisely what broke the bump workflow it ships alongside. - The push trigger now watches .github/workflows/nix-check.yml like the pull_request trigger already did, so an edit to the check itself is checked on both legs. - bump-nix-package.yml drops `pull-requests: write`. The PR is opened with the PAT now, so that grant on GITHUB_TOKEN buys nothing. @
1 parent 4a4ec2f commit e67d665

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/bump-nix-package.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ on:
1010
required: true
1111
type: string
1212

13+
# GITHUB_TOKEN only pushes the branch here — the PR itself is opened with the
14+
# PAT below, so no `pull-requests: write` is needed (and it never worked).
1315
permissions:
1416
contents: write
15-
pull-requests: write
1617

1718
jobs:
1819
bump:

.github/workflows/nix-check.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ on:
2929
paths:
3030
- package-lock.json
3131
- nix/**
32+
- .github/workflows/nix-check.yml
33+
34+
# Read-only, and stated rather than inherited: the repo default happens to be
35+
# `read` today, which is exactly the kind of repo-level setting that silently
36+
# changed this workflow's sibling out from under it.
37+
permissions:
38+
contents: read
3239

3340
jobs:
3441
npm-deps-hash:

0 commit comments

Comments
 (0)