mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-05-13 10:07:00 +08:00
Clean up sync script
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run script/sync-data and push changes.
|
||||
|
||||
set -x # print commands before execution
|
||||
set -o errexit # always exit on error
|
||||
set -o pipefail # honor exit codes when piping
|
||||
set -e
|
||||
|
||||
echo "===> Syncing data"
|
||||
script/sync-data
|
||||
@@ -14,9 +12,10 @@ git diff --quiet || {
|
||||
|
||||
REPO=`git config remote.origin.url`
|
||||
|
||||
# If GH_TOKEN environment variable is present, use that to push.
|
||||
if [[ -n "$GH_TOKEN" ]]; then
|
||||
REPO=${REPO/https:\/\//https://${GH_TOKEN}@}
|
||||
fi
|
||||
|
||||
git push $REPO HEAD:$TRAVIS_BRANCH
|
||||
git push $REPO HEAD:master
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user