fix: resolve gitleaks version dynamically from GitHub API
Some checks failed
CI / secrets (push) Failing after 9s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 26s
CI / build (push) Has been skipped

The /releases/latest/download/ URL doesn't expand version in
the filename. Query the redirect to resolve actual version first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-22 08:24:47 +01:00
parent ed513251db
commit 18992c63e1

View File

@@ -53,7 +53,8 @@ jobs:
- name: Install gitleaks
run: |
ARCH=$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/')
curl -sSL "https://github.com/gitleaks/gitleaks/releases/latest/download/gitleaks_8.22.1_linux_${ARCH}.tar.gz" \
VER=$(curl -sI https://github.com/gitleaks/gitleaks/releases/latest | grep -i location | grep -oE 'v[0-9.]+' | tr -d v)
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${VER}/gitleaks_${VER}_linux_${ARCH}.tar.gz" \
| tar xz -C /usr/local/bin/ gitleaks
- name: Scan for secrets
run: gitleaks detect --source . -v