name: GitHub Actions Security Analysis

on:
  push:
    branches: [main, next]
    paths:
      - '.github/workflows/**'
      - '.github/zizmor.yml'
  pull_request:
    paths:
      - '.github/workflows/**'
      - '.github/zizmor.yml'

permissions: {}

jobs:
  zizmor:
    if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      contents: read
      actions: read
    steps:
      - name: Checkout repository
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          persist-credentials: false

      - name: Run zizmor
        uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
