Skip to content

Commit ffb765e

Browse files
committed
Add zizmor GitHub workflow integration
1 parent 6ef8578 commit ffb765e

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,17 @@ jobs:
114114
fail_ci_if_error: true # optional (default = false)
115115
verbose: true # optional (default = false)
116116

117+
zizmor:
118+
uses: ./.github/workflows/reusable-zizmor.yml
119+
permissions:
120+
security-events: write
121+
117122
check: # This job does nothing and is only used for the branch protection
118123
if: always()
119124
needs:
120125
- build
121126
- test
127+
- zizmor
122128
runs-on: ubuntu-24.04
123129
timeout-minutes: 5
124130

.github/workflows/reusable-zizmor.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Reusable zizmor
3+
4+
permissions: {}
5+
6+
on:
7+
workflow_call:
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
zizmor:
14+
name: zizmor
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
security-events: write
18+
timeout-minutes: 5
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
- name: Install uv
25+
# yamllint disable-line rule:line-length
26+
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04 # v6.0.0
27+
with:
28+
# yamllint disable-line rule:line-length
29+
enable-cache: | # zizmor: ignore[cache-poisoning] cache is disabled when publishing to prevent poisoning
30+
${{ github.ref_type == 'tag' && 'false' || 'auto' }}
31+
- name: Run zizmor 🌈
32+
run: uvx zizmor --format=sarif . > results.sarif
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Upload SARIF file
36+
uses: github/codeql-action/upload-sarif@v3
37+
with:
38+
sarif_file: results.sarif
39+
category: zizmor

0 commit comments

Comments
 (0)