name: Workflow security (zizmor)

on:
  push:
    paths: ['.github/workflows/**']
  pull_request:
    paths: ['.github/workflows/**']
  schedule:
    - cron: '15 3 * * 1'   # Monday 03:15 UTC

permissions:
  contents: read
  security-events: write

jobs:
  zizmor:
    name: zizmor SAST
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
        with:
          persist-credentials: false

      - id: zizmor
        uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7

      - uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
        with:
          sarif_file: ${{ steps.zizmor.outputs.output-file }}
