From d2a4b07e27df581475d9cc78b2873477ee870018 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Thu, 7 Jun 2018 22:08:01 +0200 Subject: [PATCH] follow ci-utils rename and easier check on empty json array --- files/check-install.sh | 8 ++++---- files/check.sh | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/files/check-install.sh b/files/check-install.sh index 09a50aa..5ca044a 100644 --- a/files/check-install.sh +++ b/files/check-install.sh @@ -30,10 +30,10 @@ for dic in $dicList done go get ./... -go get -u github.com/ewgRa/ci-utils/utils/diff_liner -go get -u github.com/ewgRa/ci-utils/utils/hunspell_parser -go get -u github.com/ewgRa/ci-utils/utils/github_comments_diff -go get -u github.com/ewgRa/ci-utils/utils/github_comments_send +go get -u github.com/ewgRa/ci-utils/cmd/diff_liner +go get -u github.com/ewgRa/ci-utils/cmd/hunspell_parser +go get -u github.com/ewgRa/ci-utils/cmd/github_comments_diff +go get -u github.com/ewgRa/ci-utils/cmd/github_comments_send go build -o /tmp/check_spell $DIR/go/check_spell/main.go go build -o /tmp/check_links $DIR/go/check_links/main.go diff --git a/files/check.sh b/files/check.sh index 9db748d..86d880b 100644 --- a/files/check.sh +++ b/files/check.sh @@ -36,15 +36,16 @@ jq -s '[.[][]]' /tmp/comments.json > /tmp/comments_array.json cat /tmp/comments_array.json -OUTPUT=$(cat /tmp/comments_array.json | grep "\[]"); -EXIT_CODE=$? +EXIT_CODE=0 -if [ $EXIT_CODE -ne 0 ]; then +if [ "$(cat /tmp/comments_array.json)" != "[]" ]; then curl -s https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST/comments > /tmp/pr_comments.json github_comments_diff -comments /tmp/comments_array.json -exists-comments /tmp/pr_comments.json > /tmp/send_comments.json curl -XPOST "https://github-api-bot.herokuapp.com/send_review?repo=$TRAVIS_REPO_SLUG&pr=$TRAVIS_PULL_REQUEST&body=Спасибо%20за%20PR.%20Обратите%20внимание%20на%20результаты%20автоматической%20проверки%20орфографии%20и%20ссылок" -d @/tmp/send_comments.json + + EXIT_CODE=1 fi exit $EXIT_CODE