Fix: Skip deletion of main branch in release pipeline

Add conditional check to prevent attempting to delete the main branch when promoting, as GitHub does not allow deletion of the default branch remotely. This resolves the workflow failure in the 'Promote and delete source' step.

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-03 23:29:53 +00:00
parent 0f70765d0d
commit b2cac32629

View File

@@ -314,7 +314,11 @@ jobs:
git checkout -B "${DST}" "origin/${SRC}" git checkout -B "${DST}" "origin/${SRC}"
git push origin "${DST}" git push origin "${DST}"
git push origin --delete "${SRC}"
# Skip deletion of main branch as GitHub does not allow deleting the default branch
if [ "${SRC}" != "main" ]; then
git push origin --delete "${SRC}"
fi
{ {
echo "### Promotion report" echo "### Promotion report"