Skip to content

Commit b140f84

Browse files
Merge pull request #134 from aws/add_hooks_to_detect_secrets
fix: add hooks to detect secrets
2 parents 06e28c8 + 3385226 commit b140f84

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v2
16+
- name: Check for secrets leak on the repo
17+
run: |
18+
git clone https://github.com/awslabs/git-secrets.git target
19+
cd target
20+
sudo make install
21+
echo "Git-secrets installation completed"
22+
git secrets --register-aws --global
23+
echo "Added aws secret templates"
24+
git secrets --scan -r ../
25+
echo "Repository scan completed"
1626
- name: Setup .NET Core
1727
uses: actions/setup-dotnet@v1
1828
with:

hooks/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
git secrets --commit_msg_hook -- "$@"

hooks/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
git secrets --pre_commit_hook -- "$@"

hooks/prepare-commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
git secrets --prepare_commit_msg_hook -- "$@"

0 commit comments

Comments
 (0)