Skip to content

Zizmor integration #1344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
# yamllint disable-line rule:line-length
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04 # v6.0.0
with:
# prevent cache poisoning
enable-cache: ${{ github.ref_type == 'tag' && 'false' || 'auto' }}
# yamllint disable-line rule:line-length
enable-cache: | # zizmor: ignore[cache-poisoning] cache is disabled when publishing to prevent poisoning
${{ github.ref_type == 'tag' && 'false' || 'auto' }}
- name: Build distribution 📦
run: uv build
- name: Check distribution 📦
Expand Down Expand Up @@ -90,8 +91,9 @@ jobs:
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04 # v6.0.0
with:
python-version: ${{ matrix.python-version }}
# prevent cache poisoning
enable-cache: ${{ github.ref_type == 'tag' && 'false' || 'auto' }}
# yamllint disable-line rule:line-length
enable-cache: | # zizmor: ignore[cache-poisoning] cache is disabled when publishing to prevent poisoning
${{ github.ref_type == 'tag' && 'false' || 'auto' }}
- name: Run pre-commit hooks
run: |
uv run make pre-commit
Expand All @@ -112,11 +114,17 @@ jobs:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

zizmor:
uses: ./.github/workflows/reusable-zizmor.yml
permissions:
security-events: write

check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- build
- test
- zizmor
runs-on: ubuntu-24.04
timeout-minutes: 5

Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/reusable-zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Reusable zizmor

permissions: {}

on:
workflow_call:

env:
FORCE_COLOR: 1

jobs:
zizmor:
name: zizmor
runs-on: ubuntu-24.04
permissions:
security-events: write
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
# yamllint disable-line rule:line-length
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04 # v6.0.0
with:
# yamllint disable-line rule:line-length
enable-cache: | # zizmor: ignore[cache-poisoning] cache is disabled when publishing to prevent poisoning
${{ github.ref_type == 'tag' && 'false' || 'auto' }}
- name: Run zizmor 🌈
run: uvx zizmor --format=sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: zizmor
Loading