From ae4f7adb65c3cbbaf1e62eccf321cc4b3391ce86 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 8 Aug 2018 20:16:16 +0000 Subject: [PATCH] Travis #916: sync github pages --- pages/files/check.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pages/files/check.sh b/pages/files/check.sh index 86d880b..b513589 100644 --- a/pages/files/check.sh +++ b/pages/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? Try to restart CI build" + 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? Try to restart ci build" + 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