update gitleaks #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name: "Find Secrets" | ||
# on: | ||
# pull_request: | ||
# push: | ||
# workflow_dispatch: | ||
# # schedule: | ||
# # - cron: "0 6 * * *" | ||
# permissions: | ||
# id-token: write | ||
# contents: read | ||
# actions: read | ||
# security-events: write | ||
# jobs: | ||
# scan: | ||
# name: gitleaks | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# - uses: gitleaks/[email protected] | ||
# name: Check any Leaked Secrets | ||
# with: | ||
# args: detect --redact -v -f sarif -r ./gitleaks_scan.sarif | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# GITLEAKS_ENABLE_COMMENTS: 'true' | ||
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} | ||
name: Gitleaks Scan | ||
on: [push, pull_request] | ||
jobs: | ||
gitleaks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Gitleaks | ||
run: | | ||
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.4.0/gitleaks_8.4.0_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks | ||
- name: Run Gitleaks | ||
run: | | ||
gitleaks detect --redact -v --exit-code=2 --report-format=sarif --report-path=results.sarif --log-level=debug | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITLEAKS_ENABLE_COMMENTS: 'true' | ||
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} | ||
- name: Upload SARIF report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gitleaks-sarif-report | ||
path: results.sarif | ||