ci: set up mirror SSH credentials before the tag existence check
This commit is contained in:
@@ -65,13 +65,6 @@ jobs:
|
||||
|
||||
REMOTE="git@ssh.github.com:yorickr/plezy.git"
|
||||
|
||||
# Already mirrored? Nothing to do (previous run may have succeeded,
|
||||
# or the tag was pushed to GitHub directly).
|
||||
if git ls-remote "${REMOTE}" "refs/tags/${TAG}" 2>/dev/null | grep -q .; then
|
||||
echo "Tag ${TAG} already exists on the GitHub build bridge - nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "${HOME}/.ssh"
|
||||
chmod 700 "${HOME}/.ssh"
|
||||
printf '%s\n' "${RELEASE_PUSH_KEY}" > "${HOME}/.ssh/id_ed25519"
|
||||
@@ -83,5 +76,12 @@ jobs:
|
||||
|
||||
export GIT_SSH_COMMAND="ssh -p 443 -i '${HOME}/.ssh/id_ed25519' -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile='${HOME}/.ssh/known_hosts'"
|
||||
|
||||
# Already mirrored? Nothing to do (previous run may have succeeded,
|
||||
# or the tag was pushed to GitHub directly).
|
||||
if git ls-remote "${REMOTE}" "refs/tags/${TAG}" 2>/dev/null | grep -q .; then
|
||||
echo "Tag ${TAG} already exists on the GitHub build bridge - nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git push "${REMOTE}" "refs/tags/${TAG}:refs/tags/${TAG}"
|
||||
echo "Mirrored tag ${TAG} to the GitHub build bridge"
|
||||
|
||||
Reference in New Issue
Block a user