fix(ci): run gitleaks as binary in node image
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 37s
PR Check / Typecheck (pull_request) Successful in 40s
PR Check / Secret scan (gitleaks) (pull_request) Failing after 4s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Security scan (Snyk) (pull_request) Failing after 1s
PR Check / AI code review (opencode) (pull_request) Successful in 7s
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 37s
PR Check / Typecheck (pull_request) Successful in 40s
PR Check / Secret scan (gitleaks) (pull_request) Failing after 4s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Security scan (Snyk) (pull_request) Failing after 1s
PR Check / AI code review (opencode) (pull_request) Successful in 7s
The gitleaks container image ships no node binary, so node-based actions like actions/checkout fail with exit code 127. Install the gitleaks v8.28.0 binary in the standard node:22-bookworm image instead.
This commit is contained in:
1 parent
ce9c090a15
commit
779cf20f45
1 file changed
+10
-3
@@ -65,14 +65,21 @@ jobs:
|
|||||||
secrets:
|
secrets:
|
||||||
name: Secret scan (gitleaks)
|
name: Secret scan (gitleaks)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
# plain node image: the gitleaks container image has no node, which
|
||||||
# gitleaks is published on GHCR only (not Docker Hub) - pin the version
|
# breaks node-based actions like actions/checkout
|
||||||
image: ghcr.io/gitleaks/gitleaks:v8.28.0
|
container: node:22-bookworm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # gitleaks scans the full history
|
fetch-depth: 0 # gitleaks scans the full history
|
||||||
|
|
||||||
|
- name: Install gitleaks
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /tmp/gitleaks.tar.gz \
|
||||||
|
https://github.com/gitleaks/gitleaks/releases/download/v8.28.0/gitleaks_8.28.0_linux_x64.tar.gz
|
||||||
|
tar -xzf /tmp/gitleaks.tar.gz -C /usr/local/bin gitleaks
|
||||||
|
gitleaks version
|
||||||
|
|
||||||
- name: Scan for leaked secrets
|
- name: Scan for leaked secrets
|
||||||
run: gitleaks detect --source . --redact --verbose
|
run: gitleaks detect --source . --redact --verbose
|
||||||
# Already-committed secrets that you've accepted? Add a .gitleaksignore
|
# Already-committed secrets that you've accepted? Add a .gitleaksignore
|
||||||
|
|||||||
Reference in new issue
Block a user