2020-06-15 16:15:54 +00:00
|
|
|
#!/bin/sh -l
|
|
|
|
set -e
|
2022-03-31 22:16:14 +00:00
|
|
|
export PATH="$PATH:/usr/local/go/bin"
|
2020-06-15 16:15:54 +00:00
|
|
|
|
2022-03-31 22:16:14 +00:00
|
|
|
cd "$GITHUB_WORKSPACE"
|
2020-06-15 16:15:54 +00:00
|
|
|
|
|
|
|
cp go.mod go.mod.orig
|
|
|
|
cp go.sum go.sum.orig
|
|
|
|
|
2022-03-24 19:00:53 +00:00
|
|
|
go mod tidy -compat=1.17
|
2020-06-15 16:15:54 +00:00
|
|
|
|
|
|
|
echo "Checking go.mod and go.sum:"
|
|
|
|
checks=0
|
|
|
|
if [ "$(diff -s go.mod.orig go.mod | grep -c 'Files go.mod.orig and go.mod are identical')" = 1 ]; then
|
|
|
|
echo "- go.mod is up to date."
|
|
|
|
checks=$((checks + 1))
|
|
|
|
else
|
|
|
|
echo "- go.mod is NOT up to date."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(diff -s go.sum.orig go.sum | grep -c 'Files go.sum.orig and go.sum are identical')" = 1 ]; then
|
|
|
|
echo "- go.sum is up to date."
|
|
|
|
checks=$((checks + 1))
|
|
|
|
else
|
|
|
|
echo "- go.sum is NOT up to date."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $checks -eq 2 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Notify of any issues.
|
|
|
|
echo "Run 'go mod tidy' to update."
|
|
|
|
exit 1
|