Skip to content

Commit

Permalink
Add pre-commit support (#552)
Browse files Browse the repository at this point in the history
* Add pre-commit support

* Update README.md
  • Loading branch information
Pavel Shklovsky authored Apr 22, 2021
1 parent 12d276a commit e7553b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- id: gitleaks
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: gitleaks
language: golang
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
```
Expand Down

0 comments on commit e7553b0

Please sign in to comment.