Skip to content

Commit db58252

Browse files
authored
🔒️ Add zizmor setup in workflow (#868)
1 parent ab8ec94 commit db58252

5 files changed

Lines changed: 55 additions & 6 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ updates:
55
directory: /
66
schedule:
77
interval: weekly
8+
cooldown:
9+
default-days: 7
810
labels:
911
- "topic: dependencies"
1012
- "tool: github-actions"
@@ -19,6 +21,8 @@ updates:
1921
directory: /
2022
schedule:
2123
interval: weekly
24+
cooldown:
25+
default-days: 7
2226
allow:
2327
- dependency-type: all
2428
ignore:

.github/workflows/ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: CI
2-
permissions: read-all
2+
permissions: {}
33

44
on:
55
push:
@@ -18,10 +18,13 @@ jobs:
1818
lint:
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 1
21+
permissions:
22+
contents: read
2123

2224
steps:
2325
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24-
26+
with:
27+
persist-credentials: false
2528
- name: typos
2629
uses: crate-ci/typos@6ac2ebd1b93eade61faf7e12688ad87a073fea59 # v1.46.0
2730

@@ -47,13 +50,16 @@ jobs:
4750
basedpyright:
4851
runs-on: ubuntu-latest
4952
timeout-minutes: 5
53+
permissions:
54+
contents: read
5055
strategy:
5156
fail-fast: false
5257
matrix:
5358
py: ["3.11", "3.12", "3.13", "3.14"]
5459
steps:
5560
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
56-
61+
with:
62+
persist-credentials: false
5763
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
5864
with:
5965
python-version: ${{ matrix.py }}
@@ -64,13 +70,16 @@ jobs:
6470
mypy:
6571
runs-on: ubuntu-latest
6672
timeout-minutes: 5
73+
permissions:
74+
contents: read
6775
strategy:
6876
fail-fast: false
6977
matrix:
7078
py: ["3.11", "3.12", "3.13", "3.14"]
7179
steps:
7280
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73-
81+
with:
82+
persist-credentials: false
7483
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
7584
with:
7685
python-version: ${{ matrix.py }}
@@ -83,14 +92,17 @@ jobs:
8392
stubtest:
8493
runs-on: ${{ matrix.os }}
8594
timeout-minutes: 5
95+
permissions:
96+
contents: read
8697
strategy:
8798
fail-fast: false
8899
matrix:
89100
os: [ubuntu-latest, macos-latest, windows-latest]
90101
py: ["3.11", "3.12", "3.13", "3.14"]
91102
steps:
92103
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
93-
104+
with:
105+
persist-credentials: false
94106
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
95107
with:
96108
python-version: ${{ matrix.py }}

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27-
27+
with:
28+
persist-credentials: false
2829
- name: Configure Git Credentials
2930
run: |
3031
git config user.name github-actions[bot]

.github/workflows/publish-pypi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ jobs:
1818
id-token: write
1919
steps:
2020
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
2123
- name: setup uv
2224
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2325
with:
2426
python-version: "3.14"
27+
enable-cache: false
2528
- name: uv build
2629
run: uv build
2730
- name: publish to PyPI

.github/workflows/zizmor.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: zizmor
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
zizmor:
17+
name: zizmor
18+
runs-on: ubuntu-latest
19+
permissions:
20+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
21+
contents: read # Only needed for private repos. Needed to clone the repo.
22+
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
27+
28+
- name: run zizmor
29+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

0 commit comments

Comments
 (0)