Skip to content

Commit 667a768

Browse files
committed
ci: least-privilege permissions for the new Go jobs
Give go-test and go-lint contents: read permissions and disable credential persistence on their checkouts; clarify in CONTRIBUTING that the _check nox sessions are a CI-side verification, not a local step.
1 parent dcb5971 commit 667a768

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,13 @@ jobs:
216216
go-test:
217217
runs-on: ubuntu-latest
218218
name: "Run go tests"
219+
permissions:
220+
contents: read
219221
steps:
220222
- name: Checkout repository
221223
uses: actions/checkout@v7
224+
with:
225+
persist-credentials: false
222226

223227
- name: Set up Go
224228
uses: actions/setup-go@v7
@@ -231,9 +235,13 @@ jobs:
231235
go-lint:
232236
runs-on: ubuntu-latest
233237
name: "Run golangci-lint"
238+
permissions:
239+
contents: read
234240
steps:
235241
- name: Checkout repository
236242
uses: actions/checkout@v7
243+
with:
244+
persist-credentials: false
237245

238246
- name: Set up Go
239247
uses: actions/setup-go@v7

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ Extra pytest arguments pass through after `--`, e.g.
101101
2. Rebuild the WASM plugin (see above).
102102
3. `uv run nox` - regenerates the fixtures and runs every check on them. The default
103103
sessions include `pytest`, so have the PostgreSQL from the section above running.
104+
The `_check` sessions are not needed locally: they verify committed fixtures
105+
against a fresh regeneration, which is what CI does with the files you commit.
104106
4. If your change affects generated output, add coverage: a query/schema case in the test matrix
105107
that pins the new behavior, plus a runtime test where it makes sense. CI gates pull requests
106108
on patch coverage, so aim for covering every branch of code your PR adds.

0 commit comments

Comments
 (0)