| 1 | name: GitHub Actions Security Analysis with zizmor 🌈 |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | paths: |
| 8 | - ".github/**" |
| 9 | - flake.lock |
| 10 | pull_request: |
| 11 | paths: |
| 12 | - ".github/**" |
| 13 | - flake.lock |
| 14 | |
| 15 | permissions: {} |
| 16 | |
| 17 | jobs: |
| 18 | zizmor: |
| 19 | name: Run zizmor against GitHub Action workflows |
| 20 | runs-on: ubuntu-latest |
| 21 | permissions: |
| 22 | security-events: write |
| 23 | steps: |
| 24 | - name: Clone repository |
| 25 | uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 |
| 26 | with: |
| 27 | persist-credentials: false |
| 28 | |
| 29 | - name: Install nix |
| 30 | uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31 |
| 31 | |
| 32 | - name: Run zizmor 🌈 |
| 33 | env: |
| 34 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | run: | |
| 36 | nix run --inputs-from . nixpkgs-unstable#zizmor -- \ |
| 37 | --format sarif --pedantic . > results.sarif |
| 38 | |
| 39 | - name: Upload SARIF file |
| 40 | uses: github/codeql-action/upload-sarif@7188fc363630916deb702c7fdcf4e481b751f97a # v4 |
| 41 | with: |
| 42 | sarif_file: results.sarif |
| 43 | category: zizmor |