Skip to content

Commit

Permalink
Add simple pre-commit hook for local use
Browse files Browse the repository at this point in the history
  • Loading branch information
meg-codes committed Aug 31, 2018
1 parent 9dca152 commit fd8e424
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Check for unencrypted vault files and block commits

unencrypted=$(find . -name vault.yml -exec grep -L "\$ANSIBLE_VAULT" {} \;)

if [[ $unencrypted ]]; then
echo -e "The following vault files are not encrypted:\n$unencrypted"
exit 1
else
exit 0
fi

0 comments on commit fd8e424

Please sign in to comment.