Skip to content

Commit 866bbca

Browse files
committed
chore: check if git-secrets already configured
1 parent 30e4b70 commit 866bbca

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"--network=host"
2323
],
2424
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
25-
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
25+
"postCreateCommand": "bash .devcontainer/../scripts/install-git-secrets.sh",
2626
"features": {
2727
},
2828
"customizations": {

scripts/install-git-secrets.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if ! git config --get-all secrets.patterns | grep -Fq AKIA; then
3+
git-secrets --register-aws
4+
fi
5+
if ! git config --get-all secrets.providers | grep -Fxq "cat /usr/share/secrets-scanner/nhsd-rules-deny.txt"; then
6+
git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt
7+
fi

0 commit comments

Comments
 (0)