name: gitleaks
on:
  push:
    branches: ["main"]
    tags: ["v*"]
  pull_request:
permissions:
  contents: read
jobs:
  gitleaks:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      actions: read
      contents: read
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0
      - uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}
        if: ${{ env.GITLEAKS_LICENSE != '' }}
      - uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
        if: ${{ env.GITLEAKS_LICENSE != '' }}
        with:
          sarif_file: results.sarif
