Last active
April 9, 2019 16:21
-
-
Save bilzard/56eaf032d960283303b52446cddddc69 to your computer and use it in GitHub Desktop.
aws_iam_policy_attachment を含む commit を reject する pre-commit hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TABOO_WORD=aws_iam_policy_attachment | |
# 最新のコミットとの差分を比較し、タブー語を追加差分に含む場合は reject する | |
git diff HEAD -U0 "*.tf" | grep '^+' | grep -v '^++' | grep "$TABOO_WORD" 1>/dev/null 2>/dev/null | |
if [ $? -eq 0 ]; then | |
echo "[pre-commit FAILED..] 🔥 $TABOO_WORD は見つけ次第撲滅します!!!🔥" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment