Created
December 6, 2018 15:32
-
-
Save trlinkin/5d6604cc169f98c28dfab2fc15d3b60a to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
fail=0 | |
amount=0 | |
for f in $(git diff-tree --no-commit-id --name-only -r HEAD) | |
do | |
if [[ $f =~ lib/facter/.*rb$ ]] | |
then | |
echo "Changed Made to Ruby Fact ${f} - further review needed" | |
fail=1 | |
amount=$(( amount + 1 )) | |
else | |
echo "${f} is not a Ruby Fact" | |
fi | |
done | |
if [ $fail -eq 1 ] | |
then | |
echo "${amount} security issues have been detected" | |
exit 1 | |
else | |
echo "Module has no modified Ruby Facts" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment