Skip to content

Commit 6606bac

Browse files
committed
Fix gitleaks to use the binary directly instead of the action
1 parent a25a963 commit 6606bac

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ jobs:
4545
with:
4646
fetch-depth: 0
4747

48+
- name: Install Gitleaks
49+
run: |
50+
GITLEAKS_VERSION=8.29.0
51+
curl -sSL https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz \
52+
| tar -xz gitleaks
53+
sudo mv gitleaks /usr/local/bin/gitleaks
54+
4855
- name: Run Gitleaks
49-
uses: gitleaks/gitleaks-action@v2
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
56+
run: gitleaks detect --source . --config .gitleaks.toml --no-banner
5357

5458
- name: Set up Python
5559
uses: actions/setup-python@v5

.gitleaks.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ paths = [
1515
'''\.gitleaks\.toml$''',
1616
'''\.secrets\.baseline$''', # used for detect-secrets
1717
]
18+
regexes = [
19+
'''"image/png": ".*"''', # Ignores base64 image strings in JSON
20+
'''"hash": ".*"''', # Ignores hashes in metadata
21+
]

0 commit comments

Comments
 (0)