spacemacs/.circleci/push

30 lines
809 B
Bash
Executable File

#!/usr/bin/env bash
## push Push changes to Spacemacs bot account.
##
## Copyright (c) 2014-2021 Sylvain Benner & Contributors
##
## Author: Eugene Yaremenko
## URL: https://github.com/syl20bnr/spacemacs
##
## This file is not part of GNU Emacs.
##
## License: GPLv3
echo_headline "Creating fork under bot account"
export GITHUB_TOKEN=$UPD_BOT_GIT_TK
hub fork
if [ $? -ne 0 ]; then
echo "hub fork failed"
exit 2
fi
fork_url="https://${UPD_BOT_LOGIN}:${UPD_BOT_GIT_TK}"
fork_url+="@github.com/${UPD_BOT_LOGIN}/${UPD_BOT_REPO}.git"
git remote set-url "${UPD_BOT_LOGIN}" "${fork_url}"
echo_headline "Pushing changes"
hub push -f "${UPD_BOT_LOGIN}" "${PUBLISH}" > /dev/null 2>&1
# prevent token leak ^^^^^^^^^^^^^^
if [ $? -ne 0 ]; then
echo "hub push failed"
exit 2
fi