Skip to content
Latchkey

GitHub Actions Security Analysis with zizmor 🌈 workflow (python-jsonschema/jsonschema)

The GitHub Actions Security Analysis with zizmor 🌈 workflow from python-jsonschema/jsonschema, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: python-jsonschema/jsonschema.github/workflows/zizmor.ymlLicense MITView source

What it does

This is the GitHub Actions Security Analysis with zizmor 🌈 workflow from the python-jsonschema/jsonschema repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: GitHub Actions Security Analysis with zizmor 🌈

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["**"]

permissions: {}

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  zizmor:
    name: Run zizmor
    runs-on: ubuntu-latest
    permissions:
      security-events: write  # for uploading SARIF results to GitHub code scanning

    steps:
      - name: Checkout repository
        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
        with:
          persist-credentials: false

      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0

      - name: Run zizmor 🌈
        run: uvx zizmor --pedantic --format=sarif .github > results.sarif

        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Upload SARIF file
        uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
        with:
          sarif_file: results.sarif
          category: zizmor

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: GitHub Actions Security Analysis with zizmor 🌈
 
on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["**"]
 
permissions: {}
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
 
jobs:
  zizmor:
    timeout-minutes: 30
    name: Run zizmor
    runs-on: latchkey-small
    permissions:
      security-events: write  # for uploading SARIF results to GitHub code scanning
 
    steps:
      - name: Checkout repository
        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
        with:
          persist-credentials: false
 
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
 
      - name: Run zizmor 🌈
        run: uvx zizmor --pedantic --format=sarif .github > results.sarif
 
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
      - name: Upload SARIF file
        uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
        with:
          sarif_file: results.sarif
          category: zizmor
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow