OVMS3-idf/tools/ci/push_to_github.sh
Angus Gratton 7b4626f824 ci: Fix spurious pipeline failure when deploying a tag to GitHub
Everything succeeds, but because [ -z ${CI_COMMIT_TAG} ] on the last line returns non-zero, it
fails the job.
2018-08-22 13:11:18 +10:00

14 lines
289 B
Bash
Executable file

#!/bin/bash
# gitlab-ci script to push current tested revision (tag or branch) to github
set -ex
if [ -n "${CI_COMMIT_TAG}" ]; then
# for tags
git push github "${CI_COMMIT_TAG}"
else
# for branches
git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
fi