File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2556,6 +2556,26 @@ in
2556
2556
entry = "${ hooks . detect-private-keys . package } /bin/detect-private-key" ;
2557
2557
types = [ "text" ] ;
2558
2558
} ;
2559
+ detect-secrets =
2560
+ {
2561
+ name = "detect-secrets" ;
2562
+ description = "An enterprise friendly way of detecting and preventing secrets in code." ;
2563
+ package = tools . detect-secrets ;
2564
+ entry =
2565
+ let
2566
+ # 1. Check if `.secrets.baseline` exists if not we need to run `detect-secrets scan` to create it.
2567
+ # 2. Run `detect-secrets audit .secrets.baseline` to scan the files.
2568
+ script = pkgs . writeShellScript "precommit-detect-secrets" ''
2569
+ if [ ! -f .secrets.baseline ]; then
2570
+ ${ hooks . detect-secrets . package } /bin/detect-secrets scan
2571
+ fi
2572
+ ${ hooks . detect-secrets . package } /bin/detect-secrets audit .secrets.baseline
2573
+ '' ;
2574
+ in
2575
+ toString
2576
+ script ;
2577
+ types = [ "text" ] ;
2578
+ } ;
2559
2579
dhall-format = {
2560
2580
name = "dhall-format" ;
2561
2581
description = "Dhall code formatter." ;
You can’t perform that action at this time.
0 commit comments