diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 000000000..ac771c8b7 --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,30 @@ +name: Gitleaks Secret Scan + +on: + push: + pull_request: + +jobs: + gitleaks: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Scan git commit history + uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} # Only required for Organizations, not personal accounts. + + - name: Scan codebase (working tree) + uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITLEAKS_SCAN_MODE: detect + GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} # Only required for Organizations, not personal accounts. + GITLEAKS_ENABLE_UPLOAD_ARTIFACT: "false" \ No newline at end of file