Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ jobs:

# Installed from the release tarball rather than the marketplace action,
# which requires a paid licence key for organization-owned repositories.
#
# Pinned deliberately, for the same reason the retina repos pin ruff: this
# is a required check, so resolving `releases/latest` at run time let a new
# gitleaks release change what the gate accepts with no commit here and no
# way to tell a real new finding from a rules change. Bump VERSION and
# SHA256 together; each release ships gitleaks_<VERSION>_checksums.txt.
#
# The tarball is written to disk and verified before extraction rather than
# piped straight into tar, so nothing unverified is ever unpacked. `-f`
# makes curl fail on an HTTP error page instead of handing tar an HTML
# document, and --retry covers the transient TLS failure seen on ops#2.
- name: Install gitleaks
env:
GITLEAKS_VERSION: "8.30.1"
GITLEAKS_SHA256: "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb"
run: |
set -euo pipefail
TAG="$(curl -sSL https://api.github.com/repos/gitleaks/gitleaks/releases/latest | jq -r .tag_name)"
VERSION="${TAG#v}"
echo "installing gitleaks ${TAG}"
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/${TAG}/gitleaks_${VERSION}_linux_x64.tar.gz" \
| tar -xz gitleaks
TARBALL="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
echo "installing gitleaks ${GITLEAKS_VERSION}"
curl -fsSL --retry 3 --retry-delay 5 -o "${TARBALL}" \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${TARBALL}"
echo "${GITLEAKS_SHA256} ${TARBALL}" | sha256sum -c -
tar -xzf "${TARBALL}" gitleaks
sudo install -m 755 gitleaks /usr/local/bin/gitleaks
gitleaks version

Expand Down
Loading