File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - uses : actions/checkout@v4
2121 with :
2222 fetch-depth : 0
23- - uses : gitleaks/gitleaks-action@v2
24- env :
25- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26- GITLEAKS_LICENSE : ${{ secrets.GITLEAKS_LICENSE }}
23+ - name : Install gitleaks
24+ run : |
25+ GITLEAKS_VERSION=8.30.1
26+ ARCHIVE="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
27+ CHECKSUMS="gitleaks_${GITLEAKS_VERSION}_checksums.txt"
28+ BASE_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}"
29+
30+ curl -sSLO "${BASE_URL}/${ARCHIVE}"
31+ curl -sSLO "${BASE_URL}/${CHECKSUMS}"
32+ grep "${ARCHIVE}" "${CHECKSUMS}" | sha256sum -c -
33+ tar -xzf "${ARCHIVE}" gitleaks
34+ sudo mv gitleaks /usr/local/bin/gitleaks
35+
36+ - name : Run gitleaks on PR commits
37+ if : github.event_name == 'pull_request'
38+ run : |
39+ gitleaks git --log-opts="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" --verbose --redact
40+
41+ - name : Run gitleaks on repository history
42+ if : github.event_name != 'pull_request'
43+ run : |
44+ gitleaks git --verbose --redact
You can’t perform that action at this time.
0 commit comments