fix: select matching gitleaks binary for arm64 runners

This commit is contained in:
yyovil 2026-04-19 18:49:04 +05:30
parent 62084daf5d
commit f4916bea63
1 changed files with 16 additions and 1 deletions

View File

@ -29,7 +29,22 @@ jobs:
set -euo pipefail
GITLEAKS_VERSION="8.24.3"
GITLEAKS_BASE_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}"
ARCHIVE_NAME="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
RUNNER_ARCH="$(uname -m)"
case "${RUNNER_ARCH}" in
x86_64|amd64)
GITLEAKS_ARCH="x64"
;;
aarch64|arm64)
GITLEAKS_ARCH="arm64"
;;
*)
echo "Unsupported runner architecture: ${RUNNER_ARCH}" >&2
exit 1
;;
esac
ARCHIVE_NAME="gitleaks_${GITLEAKS_VERSION}_linux_${GITLEAKS_ARCH}.tar.gz"
# Download gitleaks archive using the release filename so checksum verification works
curl -sSfL "${GITLEAKS_BASE_URL}/${ARCHIVE_NAME}" -o "${ARCHIVE_NAME}"