Validate deps in CI

This commit is contained in:
Brian Goff
2018-08-03 10:41:55 -07:00
parent ae79bb5216
commit a1f46e7f04
2 changed files with 17 additions and 1 deletions

16
scripts/validate/dep.sh Executable file
View File

@@ -0,0 +1,16 @@
validate_dep() {
dep ensure
nChanges=$(git status --porcelain -u | wc -l)
[ $nChanges -eq 0 ]
}
validate_dep || {
ret=$?
echo '`dep ensure` was not run. Make sure dependency changes are committed to the repository.'
echo 'You may also need to check that all deps are pinned to a commit or tag instead of a branch or HEAD.'
echo 'Check Gopkg.toml and Gopkg.lock'
git diff Gopkg.toml Gopkg.lock
exit $ret
}