From 1d26ea56c6ee240113b881d9c1e224bee8194242 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Wed, 8 Aug 2018 22:00:32 +0200 Subject: [PATCH] test --- files/check.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/files/check.sh b/files/check.sh index 86d880b..bd93430 100644 --- a/files/check.sh +++ b/files/check.sh @@ -12,6 +12,12 @@ git config --global core.quotepath false git diff HEAD^ --name-status | grep "^D" -v | sed 's/^.\t//g' | grep "\.md$" > /tmp/changed_files curl -sH "Accept: application/vnd.github.v3.diff.json" https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST > /tmp/pr.diff + +if [ "$?" != "0" ]; then + echo "Can't get github pull request diff, probably rate limit?" + exit 1 +fi + cat /tmp/pr.diff | diff_liner > /tmp/pr_liner.json rm -f /tmp/comments.json @@ -41,6 +47,11 @@ EXIT_CODE=0 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 + if [ "$?" != "0" ]; then + echo "Can't get github comments, probably rate limit?" + exit 1 + fi + 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