Skip to content

Commit 2cb0bf5

Browse files
authored
Add zizmor pre-commit (#732)
1 parent b86a2c0 commit 2cb0bf5

7 files changed

+46
-6
lines changed

.github/workflows/build-docker-images.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
schedule:
99
- cron: "0 1 * * *"
1010

11+
permissions: {}
12+
1113
env:
1214
PYTHON_VERSION: "3.10"
1315

@@ -25,11 +27,14 @@ jobs:
2527
2628
- name: Set up Docker Buildx
2729
uses: docker/setup-buildx-action@v3
30+
with:
31+
cache-binary: false
2832

2933
- name: Check out code
3034
uses: actions/checkout@v4
3135
with:
3236
lfs: true
37+
persist-credentials: false
3338

3439
- name: Login to DockerHub
3540
uses: docker/login-action@v3
@@ -60,11 +65,14 @@ jobs:
6065
6166
- name: Set up Docker Buildx
6267
uses: docker/setup-buildx-action@v3
68+
with:
69+
cache-binary: false
6370

6471
- name: Check out code
6572
uses: actions/checkout@v4
6673
with:
6774
lfs: true
75+
persist-credentials: false
6876

6977
- name: Login to DockerHub
7078
uses: docker/login-action@v3
@@ -89,9 +97,13 @@ jobs:
8997
steps:
9098
- name: Set up Docker Buildx
9199
uses: docker/setup-buildx-action@v3
100+
with:
101+
cache-binary: false
92102

93103
- name: Check out code
94104
uses: actions/checkout@v4
105+
with:
106+
persist-credentials: false
95107

96108
- name: Login to DockerHub
97109
uses: docker/login-action@v3

.github/workflows/nightly-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
schedule:
88
- cron: "0 2 * * *"
99

10+
permissions: {}
11+
1012
# env:
1113
# SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
1214
jobs:

.github/workflows/quality.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches:
99
- main
1010

11+
permissions: {}
12+
1113
env:
1214
PYTHON_VERSION: "3.10"
1315

@@ -17,7 +19,9 @@ jobs:
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout Repository
20-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
2125

2226
- name: Set up Python
2327
uses: actions/setup-python@v4
@@ -45,7 +49,9 @@ jobs:
4549
runs-on: ubuntu-latest
4650
steps:
4751
- name: Checkout Repository
48-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
53+
with:
54+
persist-credentials: false
4955

5056
- name: Install poetry
5157
run: pipx install "poetry<2.0.0"
@@ -59,7 +65,9 @@ jobs:
5965
runs-on: ubuntu-latest
6066
steps:
6167
- name: Checkout Repository
62-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
69+
with:
70+
persist-credentials: false
6371

6472
- name: Install poetry
6573
run: pipx install "poetry<2.0.0"

.github/workflows/test-docker-build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
# Run only when DockerFile files are modified
99
- "docker/**"
1010

11+
permissions: {}
12+
1113
env:
1214
PYTHON_VERSION: "3.10"
1315

@@ -20,6 +22,8 @@ jobs:
2022
steps:
2123
- name: Check out code
2224
uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
2327

2428
- name: Get changed files
2529
id: changed-files
@@ -34,7 +38,7 @@ jobs:
3438
env:
3539
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
3640
run: |
37-
echo "matrix=${{ steps.changed-files.outputs.all_changed_files}}" >> $GITHUB_OUTPUT
41+
echo "matrix=${ALL_CHANGED_FILES}" >> $GITHUB_OUTPUT
3842
3943
4044
build_modified_dockerfiles:
@@ -50,9 +54,13 @@ jobs:
5054
steps:
5155
- name: Set up Docker Buildx
5256
uses: docker/setup-buildx-action@v3
57+
with:
58+
cache-binary: false
5359

5460
- name: Check out code
5561
uses: actions/checkout@v4
62+
with:
63+
persist-credentials: false
5664

5765
- name: Build Docker image
5866
uses: docker/build-push-action@v5

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ on:
2222
- "Makefile"
2323
- ".cache/**"
2424

25+
permissions: {}
26+
2527
jobs:
2628
pytest:
2729
name: Pytest
@@ -32,6 +34,7 @@ jobs:
3234
- uses: actions/checkout@v4
3335
with:
3436
lfs: true # Ensure LFS files are pulled
37+
persist-credentials: false
3538

3639
- name: Install apt dependencies
3740
# portaudio19-dev is needed to install pyaudio
@@ -72,6 +75,7 @@ jobs:
7275
- uses: actions/checkout@v4
7376
with:
7477
lfs: true # Ensure LFS files are pulled
78+
persist-credentials: false
7579

7680
- name: Install apt dependencies
7781
run: sudo apt-get update && sudo apt-get install -y ffmpeg
@@ -108,6 +112,7 @@ jobs:
108112
- uses: actions/checkout@v4
109113
with:
110114
lfs: true # Ensure LFS files are pulled
115+
persist-credentials: false
111116

112117
- name: Install apt dependencies
113118
# portaudio19-dev is needed to install pyaudio

.github/workflows/trufflehog.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ on:
33

44
name: Secret Leaks
55

6-
permissions:
7-
contents: read
6+
permissions: {}
87

98
jobs:
109
trufflehog:
@@ -14,6 +13,8 @@ jobs:
1413
uses: actions/checkout@v4
1514
with:
1615
fetch-depth: 0
16+
persist-credentials: false
17+
1718
- name: Secret Scanning
1819
uses: trufflesecurity/trufflehog@main
1920
with:

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ repos:
3535
rev: v8.21.2
3636
hooks:
3737
- id: gitleaks
38+
- repo: https://github.com/woodruffw/zizmor-pre-commit
39+
rev: v1.3.1
40+
hooks:
41+
- id: zizmor

0 commit comments

Comments
 (0)