Skip to content

Commit d70f262

Browse files
authored
Replace pre-commit with prek in CI and add zizmor (#172)
1 parent 107795f commit d70f262

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
- published
99
workflow_dispatch:
1010

11-
permissions:
12-
contents: read
11+
permissions: {}
1312

1413
env:
1514
FORCE_COLOR: 1
@@ -32,7 +31,7 @@ jobs:
3231
release-test-pypi:
3332
name: Publish in-dev package to test.pypi.org
3433
if: |
35-
github.repository_owner == 'python'
34+
github.event.repository.fork == false
3635
&& github.event_name == 'push'
3736
&& github.ref == 'refs/heads/main'
3837
runs-on: ubuntu-latest
@@ -58,7 +57,7 @@ jobs:
5857
name: Publish to PyPI
5958
# Only run for published releases.
6059
if: |
61-
github.repository_owner == 'python'
60+
github.event.repository.fork == false
6261
&& github.event.action == 'published'
6362
runs-on: ubuntu-latest
6463
needs: build-package

.github/workflows/lint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Lint
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions: {}
6+
57
env:
68
FORCE_COLOR: 1
79

8-
permissions:
9-
contents: read
1010

1111
jobs:
1212
lint:
@@ -19,5 +19,6 @@ jobs:
1919
- uses: actions/setup-python@v6
2020
with:
2121
python-version: "3.x"
22-
- uses: tox-dev/action-pre-commit-uv@v1
22+
- uses: astral-sh/setup-uv@v7
23+
- uses: j178/prek-action@v1
2324
- run: uvx safety check

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: tests
22

33
on: [push, pull_request, workflow_dispatch]
44

5-
permissions:
6-
contents: read
5+
permissions: {}
76

87
env:
98
FORCE_COLOR: 1

.github/zizmor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://docs.zizmor.sh/configuration/
2+
rules:
3+
unpinned-uses:
4+
config:
5+
policies:
6+
"*": ref-pin

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ repos:
4949
pass_filenames: false
5050
additional_dependencies: ["types-requests"]
5151

52+
- repo: https://github.com/woodruffw/zizmor-pre-commit
53+
rev: v1.14.2
54+
hooks:
55+
- id: zizmor
56+
5257
- repo: https://github.com/tox-dev/pyproject-fmt
5358
rev: v2.11.1
5459
hooks:

0 commit comments

Comments
 (0)