Skip to content

Commit 1173209

Browse files
committed
Merge branch 'feature/add-gitleaks-pre-commit' into 'master'
ops: add gitleaks pre-commit hook Closes infra#43 See merge request postgres-ai/database-lab!1112
2 parents 5458370 + d35b328 commit 1173209

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.30.0
4+
hooks:
5+
- id: gitleaks

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,19 @@ Components have a separate version, denoted by either:
273273
- a certain type of the git tag (for example, `v0.0.0` for Database Lab Engine, and `ui0.0.0` for Database Lab UI) or
274274
- a combination of the branch name and git commit SHA.
275275

276+
### Pre-commit hooks
277+
278+
This repo uses [pre-commit](https://pre-commit.com/) with [gitleaks](https://github.com/gitleaks/gitleaks) to catch secrets before they are committed.
279+
280+
```bash
281+
# Install pre-commit
282+
pip install pre-commit
283+
# or: brew install pre-commit
284+
285+
# Install the hooks (one-time, after cloning)
286+
pre-commit install
287+
```
288+
276289
### Development setup
277290
- Install Docker. Example for Linux:
278291
```bash

0 commit comments

Comments
 (0)