Skip to content

Commit

Permalink
ci: fix check.sh
Browse files Browse the repository at this point in the history
fast fail when install protolock failed.
  • Loading branch information
wuhuizuo committed Apr 1, 2024
1 parent d9846b0 commit c12102e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ check-protos-compatible() {
export PATH=$GOPATH/bin:$PATH

if [ ! -f "$GOPATH/bin/protolock" ]; then
go install github.com/nilslice/protolock/cmd/[email protected]
GO111MODULE=off go install github.com/nilslice/protolock/cmd/[email protected] || exit 1
fi
which protolock || {
echo "not found protolock in PATH."
ls -l "$GOPATH/bin/protolock"
exit 1
}

if protolock status -lockdir=scripts -protoroot=proto --ignore=OWNERS; then
protolock commit -lockdir=scripts -protoroot=proto --ignore=OWNERS
if protolock status -lockdir=scripts -protoroot=proto; then
protolock commit -lockdir=scripts -protoroot=proto
else
echo "Meet break compatibility problem, please check the code."
# In order not to block local branch development, when meet break compatibility will force to update `proto.lock`.
protolock commit --force -lockdir=scripts -protoroot=proto --ignore=OWNERS
protolock commit --force -lockdir=scripts -protoroot=proto
fi
# git report error like "fatal: detected dubious ownership in repository at" when reading the host's git folder
git config --global --add safe.directory $(pwd)
Expand Down

0 comments on commit c12102e

Please sign in to comment.