Skip to content

Commit 7115e9b

Browse files
committed
tighten github actions with zizmor
1 parent ff179e3 commit 7115e9b

6 files changed

Lines changed: 100 additions & 44 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"
12+
cooldown:
13+
default-days: 7
1214
# Maintain dependencies for GitHub Actions
1315
- package-ecosystem: "github-actions"
1416
directory: "/"
1517
schedule:
1618
interval: "daily"
19+
cooldown:
20+
default-days: 7

.github/workflows/ci-tests.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ concurrency:
1010
group: build-${{ github.event.pull_request.number || github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions: {}
14+
1315
jobs:
1416

1517
tox:
@@ -27,12 +29,13 @@ jobs:
2729
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
2830

2931
steps:
30-
- uses: actions/checkout@v6
32+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3133
with:
3234
fetch-depth: 0
35+
persist-credentials: false
3336

3437
- name: Set up Python
35-
uses: actions/setup-python@v6
38+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3639
with:
3740
python-version: ${{ env.py-semver }}
3841
allow-prereleases: true
@@ -47,7 +50,7 @@ jobs:
4750
pip install 'tox>=4' tox-gh-actions
4851
4952
- name: MyPy cache
50-
uses: actions/cache@v5
53+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
5154
with:
5255
path: .mypy_cache/${{ env.py-semver }}
5356
key: mypy-${{ env.py-semver }}
@@ -56,7 +59,7 @@ jobs:
5659
run: tox
5760

5861
- name: Upload coverage to Codecov
59-
uses: codecov/codecov-action@v6
62+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
6063
with:
6164
fail_ci_if_error: true
6265
env:
@@ -76,12 +79,13 @@ jobs:
7679
TOXENV: ${{ matrix.step }}
7780

7881
steps:
79-
- uses: actions/checkout@v6
82+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
8083
with:
8184
fetch-depth: 0
85+
persist-credentials: false
8286

8387
- name: Set up Python
84-
uses: actions/setup-python@v6
88+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
8589
with:
8690
python-version: ${{ env.py-semver }}
8791
cache: pip
@@ -93,7 +97,9 @@ jobs:
9397
9498
- if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}}
9599
name: Create local branch for diff-quality for PRs
96-
run: git branch ${{github.base_ref}} origin/${{github.base_ref}}
100+
run: git branch "${GITHUB_BASE_REF}" "origin/${GITHUB_BASE_REF}"
101+
env:
102+
GITHUB_BASE_REF: ${{ github.base_ref }}
97103

98104
- name: Test with tox
99105
run: tox
@@ -102,11 +108,13 @@ jobs:
102108
name: Confirm that codegen typescript passes tests with CWL
103109
runs-on: ubuntu-24.04
104110
steps:
105-
- uses: actions/checkout@v6
111+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
112+
with:
113+
persist-credentials: false
106114
- name: Set up Node
107-
uses: actions/setup-node@v6
115+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
108116
- name: Set up Python
109-
uses: actions/setup-python@v6
117+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
110118
with:
111119
python-version: 3.12
112120
cache: pip
@@ -138,9 +146,11 @@ jobs:
138146
steps:
139147
- name: Install C++ dependencies
140148
run: sudo apt-get install libyaml-cpp-dev
141-
- uses: actions/checkout@v6
149+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
150+
with:
151+
persist-credentials: false
142152
- name: Set up Python
143-
uses: actions/setup-python@v6
153+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
144154
with:
145155
python-version: 3.12
146156
cache: pip
@@ -166,15 +176,17 @@ jobs:
166176
runs-on: ubuntu-24.04
167177

168178
steps:
169-
- uses: actions/checkout@v6
179+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
180+
with:
181+
persist-credentials: false
170182

171183
- name: Set up Python
172-
uses: actions/setup-python@v6
184+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
173185
with:
174186
python-version: "3.12"
175187

176188
- name: Cache for pip
177-
uses: actions/cache@v5
189+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
178190
with:
179191
path: ~/.cache/pip
180192
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
@@ -192,7 +204,9 @@ jobs:
192204
build_test_container:
193205
runs-on: ubuntu-24.04
194206
steps:
195-
- uses: actions/checkout@v6
207+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
208+
with:
209+
persist-credentials: false
196210
- name: record schema-salad version
197211
run: |
198212
python3 -m venv env

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v6
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2626
with:
2727
# We must fetch at least the immediate parents so that if this is
2828
# a pull request then we can checkout the head.
2929
fetch-depth: 2
30+
persist-credentials: false
3031

3132
# Initializes the CodeQL tools for scanning.
3233
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@v4
34+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
3435
with:
3536
languages: python
3637

3738
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@v4
39+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4

.github/workflows/quay-publish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,30 @@ on:
44
tags:
55
- '*'
66
workflow_dispatch: {}
7+
permissions: {}
78
jobs:
89
build:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v6
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
13+
with:
14+
persist-credentials: false
1215
- name: Get image tags
1316
id: image_tags
1417
run: |
1518
echo -n "IMAGE_TAGS=${GITHUB_REF#refs/*/}" >> "${GITHUB_OUTPUT}"
1619
- name: record schema-salad version
1720
run: pip install setuptools_scm[toml] wheel && python setup.py --version
1821
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v4
22+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
2023
- name: Login to Quay.io
21-
uses: docker/login-action@v4
24+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
2225
with:
2326
registry: ${{ secrets.REGISTRY_SERVER }}
2427
username: ${{ secrets.REGISTRY_USERNAME }}
2528
password: ${{ secrets.REGISTRY_PASSWORD }}
2629
- name: Build and publish schema-salad image to Quay
27-
uses: docker/build-push-action@v7
30+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
2831
with:
2932
context: .
3033
file: schema_salad.Dockerfile

.github/workflows/wheels.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ concurrency:
1010
group: wheels-${{ github.event.pull_request.number || github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions: {}
14+
1315
jobs:
1416
build_wheels:
1517
name: ${{ matrix.image }} wheels
@@ -23,24 +25,26 @@ jobs:
2325
build: "*musllinux*"
2426

2527
steps:
26-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2729
if: ${{ github.event_name != 'repository_dispatch' }}
2830
with:
2931
fetch-depth: 0 # slow, but gets all the tags
30-
- uses: actions/checkout@v6
32+
persist-credentials: false
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3134
if: ${{ github.event_name == 'repository_dispatch' }}
3235
with:
3336
fetch-depth: 0 # slow, but gets all the tags
3437
ref: ${{ github.event.client_payload.ref }}
38+
persist-credentials: false
3539

3640
- name: ccache
37-
uses: hendrikmuhs/ccache-action@v1.2
41+
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2
3842
with:
3943
key: ${{ github.job }}-${{ matrix.image }}
4044
verbose: 2
4145

4246
# Used to host cibuildwheel
43-
- uses: actions/setup-python@v6
47+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
4448
with:
4549
python-version: "3.11 - 3.14"
4650
update-environment: false
@@ -60,7 +64,7 @@ jobs:
6064
CIBW_ARCHS_LINUX: auto64 # ppc64le s390x
6165
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/bin:/usr/lib/ccache:/usr/lib/ccache/bin:/usr/lib64/ccache:$PATH CCACHE_DIR=/host${{ github.workspace }}/.ccache CCACHE_CONFIGPATH=/host/home/runner/.config/ccache/ccache.conf CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime,locale,time_macros" CCACHE_NOHASHDIR="true" SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
6266

63-
- uses: actions/upload-artifact@v7
67+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
6468
with:
6569
name: artifact-${{ matrix.image }}
6670
path: ./wheelhouse/*.whl
@@ -69,20 +73,22 @@ jobs:
6973
name: Build source distribution
7074
runs-on: ubuntu-24.04
7175
steps:
72-
- uses: actions/checkout@v6
76+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7377
if: ${{ github.event_name != 'repository_dispatch' }}
7478
with:
7579
fetch-depth: 0 # slow, but gets all the tags
76-
- uses: actions/checkout@v6
80+
persist-credentials: false
81+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7782
if: ${{ github.event_name == 'repository_dispatch' }}
7883
with:
7984
fetch-depth: 0 # slow, but gets all the tags
8085
ref: ${{ github.event.client_payload.ref }}
86+
persist-credentials: false
8187

8288
- name: Build sdist
8389
run: pipx run build --sdist
8490

85-
- uses: actions/upload-artifact@v7
91+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
8692
with:
8793
name: artifact-sdist
8894
path: dist/*.tar.gz
@@ -97,24 +103,26 @@ jobs:
97103
# macos-14+ is apple silicon
98104
os: [macos-15-intel, macos-latest]
99105
steps:
100-
- uses: actions/checkout@v6
106+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
101107
if: ${{ github.event_name != 'repository_dispatch' }}
102108
with:
103109
fetch-depth: 0 # slow, but gets all the tags
104-
- uses: actions/checkout@v6
110+
persist-credentials: false
111+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
105112
if: ${{ github.event_name == 'repository_dispatch' }}
106113
with:
107114
fetch-depth: 0 # slow, but gets all the tags
108115
ref: ${{ github.event.client_payload.ref }}
116+
persist-credentials: false
109117

110118
- name: ccache
111-
uses: hendrikmuhs/ccache-action@v1.2
119+
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2
112120
with:
113121
key: ${{ github.job }}-${{ matrix.os }}
114122
verbose: 2
115123

116124
# Used to host cibuildwheel
117-
- uses: actions/setup-python@v6
125+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
118126
with:
119127
python-version: "3.11 - 3.14"
120128
update-environment: false
@@ -127,7 +135,7 @@ jobs:
127135
env:
128136
CIBW_ENVIRONMENT_MACOS: CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime,locale,time_macros" CCACHE_NOHASHDIR="true" PATH=/usr/local/opt/ccache/libexec:/opt/homebrew/opt/ccache/libexec:$PATH SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
129137

130-
- uses: actions/upload-artifact@v7
138+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
131139
with:
132140
name: artifact-${{ matrix.os }}-${{ strategy.job-index }}
133141
path: ./wheelhouse/*.whl
@@ -139,15 +147,17 @@ jobs:
139147
matrix:
140148
target: [ 'many', 'musl' ]
141149
steps:
142-
- uses: actions/checkout@v6
150+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
143151
if: ${{ github.event_name != 'repository_dispatch' }}
144152
with:
145153
fetch-depth: 0 # slow, but gets all the tags
146-
- uses: actions/checkout@v6
154+
persist-credentials: false
155+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
147156
if: ${{ github.event_name == 'repository_dispatch' }}
148157
with:
149158
fetch-depth: 0 # slow, but gets all the tags
150159
ref: ${{ github.event.client_payload.ref }}
160+
persist-credentials: false
151161

152162
- name: musllinux target
153163
if: ${{ matrix.target == 'musl' }}
@@ -160,19 +170,19 @@ jobs:
160170
echo "CIBW_BUILD=*manylinux*" >> "$GITHUB_ENV"
161171
162172
- name: ccache
163-
uses: hendrikmuhs/ccache-action@v1.2
173+
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2
164174
with:
165175
key: ${{ github.job }}-${{ matrix.target }}
166176
verbose: 2
167177

168178
- name: Set up QEMU
169-
uses: docker/setup-qemu-action@v4
179+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
170180
with:
171181
platforms: all
172182
id: qemu
173183

174184
# Used to host cibuildwheel
175-
- uses: actions/setup-python@v6
185+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
176186
with:
177187
python-version: "3.11 - 3.14"
178188
update-environment: false
@@ -186,7 +196,7 @@ jobs:
186196
CIBW_ARCHS_LINUX: riscv64
187197
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/bin:/usr/lib/ccache:/usr/lib/ccache/bin:/usr/lib64/ccache:$PATH CCACHE_DIR=/host${{ github.workspace }}/.ccache CCACHE_CONFIGPATH=/host/home/runner/.config/ccache/ccache.conf CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime,locale,time_macros" CCACHE_NOHASHDIR="true" SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
188198

189-
- uses: actions/upload-artifact@v7
199+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
190200
with:
191201
name: artifact-riscv64-${{ matrix.target }}
192202
path: ./wheelhouse/*.whl
@@ -199,14 +209,14 @@ jobs:
199209
id-token: write
200210
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'repository_dispatch' && github.event.client_payload.publish_wheel == true)
201211
steps:
202-
- uses: actions/download-artifact@v8
212+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
203213
with:
204214
# unpacks default artifact into dist/
205215
pattern: artifact-*
206216
merge-multiple: true
207217
path: dist
208218
skip-decompress: false
209219

210-
- uses: pypa/gh-action-pypi-publish@release/v1
220+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
211221
with:
212222
skip-existing: true

0 commit comments

Comments
 (0)