File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 19
19
with :
20
20
python-version : ' 3.9'
21
21
-
uses :
pre-commit/[email protected]
22
+ env :
23
+ SKIP : " trufflehog"
Original file line number Diff line number Diff line change
1
+ name : " Secret Scanning"
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+ workflow_call :
8
+
9
+ jobs :
10
+ check_commits :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Set depth and branch variables
14
+ run : |
15
+ if [ "${{ github.event_name }}" == "push" ]; then
16
+ echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV
17
+ echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV
18
+ fi
19
+ if [ "${{ github.event_name }}" == "pull_request" ]; then
20
+ echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV
21
+ echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
22
+ fi
23
+ - name : Checkout code
24
+ uses : actions/checkout@v3
25
+ with :
26
+ ref : ${{env.branch}}
27
+ fetch-depth : ${{env.depth}}
28
+ - uses : trufflesecurity/trufflehog@main
29
+ with :
30
+ extra_args : --results=verified,unknown
Original file line number Diff line number Diff line change 1
1
default_language_version :
2
2
python : python3.9
3
3
repos :
4
+ - repo : https://github.com/pre-commit/pre-commit-hooks
5
+ rev : " v5.0.0"
6
+ hooks :
7
+ - id : no-commit-to-branch
4
8
- repo : https://github.com/astral-sh/ruff-pre-commit
5
9
rev : ' v0.8.0'
6
10
hooks :
7
11
- id : ruff
8
12
args : [ "--fix" ]
9
13
- 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"]
You can’t perform that action at this time.
0 commit comments