Skip to content

Commit 4c1de55

Browse files
committed
Add secret scanning to repo
1 parent aba2494 commit 4c1de55

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/workflows/pre_commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ jobs:
1919
with:
2020
python-version: '3.9'
2121
- uses: pre-commit/[email protected]
22+
env:
23+
SKIP: "trufflehog"

.github/workflows/secret_scanning.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Secret Scanning"
2+
on:
3+
push:
4+
5+
jobs:
6+
check_commits:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v3
11+
- uses: trufflesecurity/trufflehog@main
12+
with:
13+
extra_args: --results=verified,unknown

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
default_language_version:
22
python: python3.9
33
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: "v5.0.0"
6+
hooks:
7+
- id: no-commit-to-branch
48
- repo: https://github.com/astral-sh/ruff-pre-commit
59
rev: 'v0.8.0'
610
hooks:
711
- id: ruff
812
args: [ "--fix" ]
913
- id: ruff-format
14+
- repo: https://github.com/trufflesecurity/trufflehog.git
15+
rev: "v3.84.2"
16+
hooks:
17+
- id: trufflehog
18+
name: TruffleHog
19+
description: Detect secrets in your data.
20+
entry: bash -c 'trufflehog git file://. --since-commit HEAD --only-verified --fail --no-update'
21+
language: system
22+
stages: ["pre-commit", "pre-push"]

0 commit comments

Comments
 (0)