diff --git a/pages/files/check-install.sh b/pages/files/check-install.sh index 09a50aa..5ca044a 100644 --- a/pages/files/check-install.sh +++ b/pages/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/pages/files/check.sh b/pages/files/check.sh index 9db748d..86d880b 100644 --- a/pages/files/check.sh +++ b/pages/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