File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Secrets scanning
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+ workflow_dispatch :
8
+ merge_group :
9
+ types : [checks_requested]
10
+
11
+ jobs :
12
+ test :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - shell : bash
16
+ run : |
17
+ if [ "${{ github.event_name }}" == "push" ]; then
18
+ echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV
19
+ echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV
20
+ fi
21
+ if [ "${{ github.event_name }}" == "pull_request" ]; then
22
+ echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV
23
+ echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
24
+ fi
25
+ - uses : actions/checkout@v4
26
+ with :
27
+ ref : ${{env.branch}}
28
+ fetch-depth : ${{env.depth}}
29
+ - name : Secret Scanning
30
+ uses : trufflesecurity/trufflehog@main
31
+ with :
32
+ extra_args : --results=verified,unknown
Original file line number Diff line number Diff line change @@ -94,3 +94,13 @@ repos:
94
94
- " requests"
95
95
- " sushy"
96
96
- " types-requests"
97
+ - repo : local
98
+ hooks :
99
+ - id : trufflehog
100
+ name : TruffleHog
101
+ description : Detect secrets in your data.
102
+ # uncomment this if you don't want to use docker version
103
+ # entry: bash -c 'trufflehog --no-update git file://. --since-commit HEAD --results=verified,unknown --fail'
104
+ entry : bash -c 'docker run --rm -v "$(pwd):/workdir" -i --rm trufflesecurity/trufflehog:latest git file:///workdir --since-commit HEAD --results=verified,unknown --fail'
105
+ language : system
106
+ stages : ["pre-commit", "pre-push"]
You can’t perform that action at this time.
0 commit comments