Skip to content

Commit 4e74385

Browse files
authored
ci: pin zizmor nightly online run (#15876)
zizmor runs in the prek phase of CI (version/sha from uv lock file), but it also runs at night, where it does additional "online" checks with the github token. In this case it checks our dependencies does some git inspection and vulnerability checking and so on. If there are problems, they are reported to the security tab. Don't just install "latest" from pypi, instead use the same pinned version used by prek. Reuse the build cache from prek to avoid downloads. Move uv minimum version specifier from setup-uv action into the pyproject.toml. The value is unchanged, but it keeps it in a single place.
1 parent a646e17 commit 4e74385

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/actions.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,23 @@ jobs:
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
with:
2222
persist-credentials: false
23+
2324
- name: Install the latest version of uv
2425
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
26+
with:
27+
version-file: dev-tools/pyproject.toml
28+
enable-cache: true
29+
save-cache: false
30+
cache-dependency-glob: dev-tools/uv.lock
31+
cache-suffix: dev-tools
32+
2533
- name: Run zizmor
26-
run: uvx zizmor --pedantic --format=sarif . > results.sarif
34+
run: uv run zizmor --pedantic --format=sarif . > results.sarif
2735
env:
36+
UV_PROJECT: dev-tools
37+
UV_FROZEN: "1"
2838
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
2940
- name: Upload SARIF file
3041
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
3142
with:

.github/workflows/run-checks-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup uv
4848
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
4949
with:
50-
version: "0.9.27"
50+
version-file: dev-tools/pyproject.toml
5151
enable-cache: true
5252
prune-cache: false
5353
save-cache: ${{ github.event_name != 'pull_request' }}

dev-tools/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dev = [
2222
# validates various
2323
"ast-grep-cli==0.42.0",
2424
]
25+
26+
[tool.uv]
27+
required-version = ">=0.9.27"

0 commit comments

Comments
 (0)