1
0
mirror of https://github.com/ru-de/faq.git synced 2024-12-22 17:01:49 +00:00

follow ci-utils rename and easier check on empty json array

This commit is contained in:
Evgeniy Sokolov 2018-06-07 22:08:01 +02:00
parent 66fddf544f
commit d2a4b07e27
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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