ci: set up mirror SSH credentials before the tag existence check

This commit is contained in:
Yorick Rommers
2026-08-12 01:08:08 +02:00
parent df887b4329
commit ad0d66803f
+7 -7
View File
@@ -65,13 +65,6 @@ jobs:
REMOTE="git@ssh.github.com:yorickr/plezy.git" 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" mkdir -p "${HOME}/.ssh"
chmod 700 "${HOME}/.ssh" chmod 700 "${HOME}/.ssh"
printf '%s\n' "${RELEASE_PUSH_KEY}" > "${HOME}/.ssh/id_ed25519" 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'" 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}" git push "${REMOTE}" "refs/tags/${TAG}:refs/tags/${TAG}"
echo "Mirrored tag ${TAG} to the GitHub build bridge" echo "Mirrored tag ${TAG} to the GitHub build bridge"