summaryrefslogtreecommitdiffstats
path: root/.github/workflows/secret-scanner.yml
blob: 82109530075102c62c841510ccf3a419c8806120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Secret-scanner workflow from Arista Networks.
on:
  pull_request:
    types: [synchronize]
  push:
    branches:
      - main
name: Secret Scanner (go/secret-scanner)
jobs:
  scan_secret:
    name: Scan incoming changes
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/aristanetworks/secret-scanner-service:main
      options: --name sss-scanner
    steps:
      - name: Checkout ${{ github.ref }}
        # Hitting https://github.com/actions/checkout/issues/334 so trying v1
        uses: actions/checkout@v1
        with:
          fetch-depth: 0
      - name: Run scanner
        run: |
          git config --global --add safe.directory $GITHUB_WORKSPACE
          scanner commit . github ${{ github.repository }} \
             --markdown-file job_summary.md \
             ${{ github.event_name == 'pull_request' && format('--since-commit {0}', github.event.pull_request.base.sha) || ''}}
      - name: Write result to summary
        run: cat ./job_summary.md >> $GITHUB_STEP_SUMMARY
        if: ${{ always() }}