mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-01-12 22:49:53 +08:00
22 lines
434 B
Bash
Executable File
22 lines
434 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run script/sync-data and push changes.
|
|
|
|
set -e
|
|
|
|
echo "===> Syncing data"
|
|
script/sync-data
|
|
|
|
git diff --quiet || {
|
|
echo "===> Committing and pushing changes"
|
|
git commit -am "Sync data"
|
|
|
|
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:master
|
|
}
|