mirror of
https://github.com/ru-de/faq.git
synced 2024-11-25 20:02:19 +00:00
Travis #835: sync github pages
This commit is contained in:
parent
d9fa771180
commit
20b297efec
@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
||||
echo "Skip, because not a PR"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
git config --global core.quotepath false
|
||||
@ -31,16 +36,14 @@ jq -s '[.[][]]' /tmp/comments.json > /tmp/comments_array.json
|
||||
|
||||
cat /tmp/comments_array.json
|
||||
|
||||
[ "${TRAVIS_PULL_REQUEST}" != "false" ] || exit 0
|
||||
|
||||
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
|
||||
|
||||
OUTPUT=$(cat /tmp/comments_array.json | grep "\[]");
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -ne 0 ]; 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
|
||||
|
||||
github_comments_send -file /tmp/send_comments.json -repo $TRAVIS_REPO_SLUG -pr $TRAVIS_PULL_REQUEST
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user