mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add script to check for uncommitted vendor changes in build
This commit is contained in:
parent
9a1b350f4e
commit
d399073695
@ -11,4 +11,4 @@ before_install:
|
||||
- cd $HOME/gopath/src/github.com/wtfutil/wtf
|
||||
- export GOPROXY="https://gocenter.io" && export GO111MODULE=on
|
||||
|
||||
script: go get ./... && go test -v github.com/wtfutil/wtf/...
|
||||
script: go get ./... && ./scripts/check-uncommitted-vendor-files.sh && go test -v github.com/wtfutil/wtf/...
|
||||
|
14
scripts/check-uncommitted-vendor-files.sh
Executable file
14
scripts/check-uncommitted-vendor-files.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
GOPROXY="https://gocenter.io" GOSUMDB=off GO111MODULE=on go mod tidy
|
||||
|
||||
untracked_files=$(git ls-files --others --exclude-standard | wc -l)
|
||||
|
||||
diff_stat=$(git diff --shortstat)
|
||||
|
||||
if [[ "${untracked_files}" -ne 0 || -n "${diff_stat}" ]]; then
|
||||
echo 'Untracked or diff in tracked vendor files found. Please run "go mod tidy" and commit the changes'
|
||||
exit 1
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user