Skip to content

Commit d0e27cd

Browse files
authored
Harden CI; add zizmor (#2952)
1 parent bfaa087 commit d0e27cd

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags: ["*"]
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
tests:
1013
name: ${{ matrix.name }}
@@ -18,17 +21,21 @@ jobs:
1821
- { name: "mypy", tox: mypy }
1922
steps:
2023
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
21-
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
2224
with:
25+
persist-credentials: false
26+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
27+
with: # zizmor: ignore[cache-poisoning] cache key is lockfile-derived
2328
enable-cache: true
2429
- run: uv run tox -e ${{ matrix.tox }}
2530
build:
2631
name: Build package
2732
runs-on: ubuntu-latest
2833
steps:
2934
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
30-
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3135
with:
36+
persist-credentials: false
37+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
38+
with: # zizmor: ignore[cache-poisoning] cache key is lockfile-derived
3239
enable-cache: true
3340
- run: uv build
3441
- run: uvx twine check --strict dist/*
@@ -44,8 +51,10 @@ jobs:
4451
runs-on: ubuntu-latest
4552
steps:
4653
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
47-
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
4854
with:
55+
persist-credentials: false
56+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
57+
with: # zizmor: ignore[cache-poisoning] cache key is lockfile-derived
4958
enable-cache: true
5059
- run: uv run tox -e lint
5160
publish-to-pypi:

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ repos:
1111
hooks:
1212
- id: check-github-workflows
1313
- id: check-readthedocs
14+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
15+
rev: v1.24.0
16+
hooks:
17+
- id: zizmor
1418
# TODO: Remove blacken-docs when https://github.com/astral-sh/ruff/issues/8237 is implemented
1519
- repo: https://github.com/asottile/blacken-docs
1620
rev: 1.20.0

0 commit comments

Comments
 (0)