name: GitGuardian Secret Scan

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

jobs:
  scanning:
    name: GitGuardian Scan
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: GitGuardian/ggshield-action@v1
        env:
          GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
          GITHUB_PUSH_BASE_SHA: ${{ github.event.base_ref }}
          GITHUB_DEFAULT_BRANCH: main
          GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
