Add .gitattributes to exclude secret files from language stats #8
This file contains hidden or 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: secrets-scan | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| # Weekly scan | |
| - cron: '0 0 * * 0' | |
| jobs: | |
| gitleaks: | |
| name: Scan for secrets | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| # Fetch all history for accurate results | |
| fetch-depth: 0 | |
| - name: Run Gitleaks | |
| uses: zricethezav/gitleaks-action@v2 | |
| with: | |
| # Use default configuration which includes many common patterns | |
| config-path: "" | |
| # Fail the build if any secrets are found | |
| fail: true | |
| # Show more detailed output | |
| verbose: true | |
| # Check the full git history | |
| fetch-depth: 0 | |
| # Additional paths to scan (optional) | |
| paths: ".,.github/workflows/" | |
| - name: Upload SARIF report | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@v2 | |
| with: | |
| sarif_file: gitleaks-report.sarif |