Skip to content

Commit 133d980

Browse files
author
Frederic Mercier
committed
add GitHub action running detect-secrets
1 parent dd691b6 commit 133d980

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/detect-secrets.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: detect secrets
2+
3+
on: push
4+
5+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
6+
jobs:
7+
# This workflow contains a single job called "detect-secrets"
8+
detect-secrets:
9+
runs-on: ubuntu-latest
10+
11+
# Steps represent a sequence of tasks that will be executed as part of the job
12+
steps:
13+
14+
# Checks-out your repository under ${{github.workspace}}, so your job can access it
15+
- uses: actions/checkout@v4
16+
17+
- name: scan all the files (not just the ones committed), generate a report, and check that there are no actual or potential secret
18+
run: |
19+
docker run --pull=always -a stdout \
20+
-v ${{github.workspace}}:/code \
21+
--entrypoint /bin/sh \
22+
icr.io/git-defenders/detect-secrets:0.13.1.ibm.61.dss-redhat-ubi \
23+
-c "detect-secrets --version;
24+
detect-secrets scan --all-files --exclude-files "^.git/.*" --update .secrets.baseline;
25+
detect-secrets audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline"

0 commit comments

Comments
 (0)