Skip to content

Commit b2f36fd

Browse files
Merge pull request #2770 from VWS-Python/add-zizmor
Add zizmor for GitHub Actions security linting
2 parents daa89a2 + 30aee41 commit b2f36fd

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
name: Test
43

54
on:
@@ -12,9 +11,10 @@ on:
1211
# Run at 1:00 every day
1312
- cron: 0 1 * * *
1413

14+
permissions: {}
15+
1516
jobs:
1617
build:
17-
1818
strategy:
1919
matrix:
2020
python-version: ['3.13']
@@ -24,6 +24,8 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v6
27+
with:
28+
persist-credentials: false
2729

2830
- name: Install uv
2931
uses: astral-sh/setup-uv@v7

.github/workflows/dependabot-merge.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
name: Dependabot auto-merge
43
on: pull_request
54

.github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
name: Lint
43

54
on:
@@ -12,9 +11,10 @@ on:
1211
# Run at 1:00 every day
1312
- cron: 0 1 * * *
1413

14+
permissions: {}
15+
1516
jobs:
1617
build:
17-
1818
strategy:
1919
matrix:
2020
python-version: ['3.13']
@@ -24,6 +24,8 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v6
27+
with:
28+
persist-credentials: false
2729

2830
- name: Install uv
2931
uses: astral-sh/setup-uv@v7

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
name: Release
43

54
on: workflow_dispatch
@@ -22,7 +21,7 @@ jobs:
2221

2322
steps:
2423
- uses: actions/checkout@v6
25-
with:
24+
with: # zizmor: ignore[artipacked] git-auto-commit-action requires credentials
2625
# See
2726
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#push-to-protected-branches
2827
token: ${{ secrets.RELEASE_PAT }}

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ci:
4040
- vulture
4141
- vulture-docs
4242
- yamlfix
43+
- zizmor
4344
- pyrefly
4445
- pyrefly-docs
4546

@@ -371,6 +372,15 @@ repos:
371372
additional_dependencies: [uv==0.9.5]
372373
stages: [pre-commit]
373374

375+
- id: zizmor
376+
name: zizmor
377+
entry: uv run --extra=dev zizmor .github
378+
language: python
379+
pass_filenames: false
380+
types_or: [yaml]
381+
additional_dependencies: [uv==0.9.5]
382+
stages: [pre-commit]
383+
374384
- id: sphinx-lint
375385
name: sphinx-lint
376386
entry: uv run --extra=dev sphinx-lint --enable=all --disable=line-too-long

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ optional-dependencies.dev = [
7979
"vws-python-mock==2025.3.10.1",
8080
"vws-test-fixtures==2023.3.5",
8181
"yamlfix==1.19.1",
82+
"zizmor==1.19.0",
8283
]
8384
optional-dependencies.release = [ "check-wheel-contents==0.6.3" ]
8485
urls.Documentation = "https://vws-python.github.io/vws-python/"
@@ -301,6 +302,7 @@ ignore = [
301302
"tests/**",
302303
"vuforia_secrets.env.example",
303304
"lint.mk",
305+
"zizmor.yml",
304306
]
305307

306308
[tool.deptry]

zizmor.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
rules:
3+
unpinned-uses:
4+
disable: true
5+
cache-poisoning:
6+
disable: true
7+
bot-conditions:
8+
disable: true
9+
dependabot-cooldown:
10+
disable: true
11+
template-injection:
12+
disable: true

0 commit comments

Comments
 (0)