Skip to content

Commit b4eb81a

Browse files
authored
Update project to Betterleaks (#29)
1 parent e499619 commit b4eb81a

6 files changed

Lines changed: 25 additions & 24 deletions

File tree

‎.github/workflows/security.yml‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,24 @@ jobs:
2424
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
2525
with:
2626
advanced-security: false
27-
gitleaks:
27+
betterleaks:
2828
runs-on: ubuntu-slim
29+
permissions:
30+
contents: read # needed to check out a private repo
2931
steps:
3032
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3133
with:
32-
persist-credentials: false
33-
fetch-depth: 0
34-
- name: Check gitleaks
35-
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
GITLEAKS_ENABLE_COMMENTS: false
34+
persist-credentials: false
35+
fetch-depth: 0
36+
# betterleaks has no official action or PyPI package, so it is built from source
37+
- name: Install Go
38+
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
39+
with:
40+
go-version: stable
41+
cache: false
42+
- name: Install betterleaks
43+
run: |
44+
go install github.com/betterleaks/betterleaks@v1.10.1
45+
- name: Scan git history for secrets
46+
run: |
47+
"$(go env GOPATH)/bin/betterleaks" git --redact .

‎Brewfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
brew "actionlint"
2-
brew "gitleaks"
2+
brew "betterleaks"
33
brew "just"
44
brew "markdownlint-cli2"
55
brew "prek"

‎CHANGELOG.md‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ template changes with `copier update`.
1212
* `uv` for dependencies and `just` as the command runner
1313
* ruff, ty, codespell, actionlint, and markdownlint for linting
1414
* pytest with coverage, Zensical docs with an API reference generated from docstrings
15-
* pip-audit, gitleaks, and zizmor for security checks
15+
* pip-audit, betterleaks, and zizmor for security checks
1616
* prek git hooks, GitHub Actions CI, Dependabot, Release Drafter, and a release workflow
1717
* A VS Code dev container
1818

@@ -82,7 +82,7 @@ Commands (requires `uv` and `just`; install `just` with `brew install just`, the
8282
* `just check` - render the demo project and run its lint, tests, docs build, pip-audit, and zizmor (used in CI)
8383
* `just actionlint` - lint the root and template GitHub workflows
8484
* `just zizmor` - audit the root and template GitHub workflows for security issues
85-
* `just git-leaks` - scan staged changes for secrets with gitleaks
85+
* `just betterleaks` - scan staged changes for secrets with betterleaks
8686
* `just prek` - run the git hooks on staged files
8787

8888
### Releases

‎justfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ default:
88
actionlint:
99
actionlint .github/workflows/*.yml template/.github/workflows/*.yml
1010
# Scan staged changes for secrets
11-
git-leaks:
12-
gitleaks git --pre-commit --staged --redact
11+
betterleaks:
12+
betterleaks git --pre-commit --staged --redact
1313
# Run the git hooks on staged files
1414
prek:
1515
prek

‎prek.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ hooks = [
3535
pass_filenames = false
3636
},
3737
{
38-
id = "git-leaks",
39-
name = "git leaks",
38+
id = "betterleaks",
39+
name = "betterleaks",
4040
language = "system",
41-
entry = "gitleaks git --pre-commit --staged --redact",
41+
entry = "just betterleaks",
4242
pass_filenames = false
4343
}
4444
]

0 commit comments

Comments
 (0)