Skip to content

Commit eccef9b

Browse files
committed
GitHub Actions: Trufflehog secrets scanning
1 parent 6ebf45d commit eccef9b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/trufflehog.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

0 commit comments

Comments
 (0)