Add pre-commit support (#552)

* Add pre-commit support

* Update README.md
This commit is contained in:
Pavel Shklovsky authored and GitHub committed 2021-04-22 18:37:28 -04:00
1 parent 12d276acd7
commit e7553b0168
2 files changed
+18 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
- id: gitleaks
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: gitleaks
language: golang
+13 -1
View File
@@ -24,7 +24,7 @@ Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys
### Installation
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases).
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo.
##### MacOS
@@ -42,6 +42,18 @@ docker pull zricethezav/gitleaks
```bash
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
```
##### As a pre-commit hook
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.
Sample `.pre-commit-config.yaml`
```yaml
- repo: https://github.com/zricethezav/gitleaks
rev: v7.4.0
hooks:
- id: gitleaks
```
### Usage and Options
```