Skip to content

Commit 4d0642d

Browse files
committed
Update ci-devsecops.yml
1 parent 7492289 commit 4d0642d

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/ci-devsecops.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,31 @@ jobs:
3030
- name: Dependency Audit
3131
run: dotnet list "ThreadPilot.csproj" package --vulnerable --include-transitive
3232

33-
- name: Secret Scan
34-
uses: gitleaks/gitleaks-action@v2
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Secret Scan (Gitleaks)
34+
shell: pwsh
35+
run: |
36+
$ErrorActionPreference = "Stop"
37+
38+
$version = "8.24.3"
39+
$baseUrl = "https://github.com/gitleaks/gitleaks/releases/download/v$version"
40+
$zipAsset = "gitleaks_${version}_windows_x64.zip"
41+
$tarAsset = "gitleaks_${version}_windows_x64.tar.gz"
42+
43+
Write-Host "Installing Gitleaks v$version"
44+
45+
try {
46+
Invoke-WebRequest -Uri "$baseUrl/$zipAsset" -OutFile "gitleaks.zip"
47+
Expand-Archive -Path "gitleaks.zip" -DestinationPath ".\\gitleaks-bin" -Force
48+
}
49+
catch {
50+
Write-Host "ZIP download failed, trying tar.gz fallback"
51+
Invoke-WebRequest -Uri "$baseUrl/$tarAsset" -OutFile "gitleaks.tar.gz"
52+
New-Item -ItemType Directory -Force -Path ".\\gitleaks-bin" | Out-Null
53+
tar -xzf "gitleaks.tar.gz" -C ".\\gitleaks-bin"
54+
}
55+
56+
$gitleaksExe = Resolve-Path ".\\gitleaks-bin\\gitleaks.exe"
57+
& $gitleaksExe version
58+
59+
# Scan working tree for hardcoded secrets.
60+
& $gitleaksExe detect --source "." --redact --verbose

0 commit comments

Comments
 (0)