Skip to content

Commit

Permalink
ci: fix the check of proto codes
Browse files Browse the repository at this point in the history
Longhorn 7985

Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed Feb 26, 2024
1 parent 60ddf25 commit d3a97f6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/validate
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ cd "$(dirname $0)"/..

echo Running proto validation

output=$(git diff --stat|grep -e '.pb.go' -e '_pb2.py' -e '_pb2_grpc.py')
if [ $? -eq 0 ]
then
echo $output
echo GRPC generated code is not up to date
check_proto_generated_code() {
local output=$(git diff --stat | grep -q -e '.pb.go' -e '_pb2.py' -e '_pb2_grpc.py')
if [ -z "$output" ]; then
return 0
else
return 1
fi
}

check_proto_generated_code
if [ $? -eq 0 ]; then
echo "GRPC generated code is up to date"
else
echo "GRPC generated code is not up to date"
exit 1
fi

Expand Down

0 comments on commit d3a97f6

Please sign in to comment.