Skip to content

Commit 4587e9f

Browse files
committed
Make release branch creation idempotent
When rerunning an existing minor-release tag, do not try to move an already existing version branch from the release workflow. The branch may be protected or intentionally maintained separately; release reruns only need the tag and release target to update.
1 parent a9487b1 commit 4587e9f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,11 @@ jobs:
223223
TAG="${GITHUB_REF#refs/tags/}"
224224
currentVersionPatch=$(echo "$TAG" | cut -d. -f3)
225225
if [[ "$currentVersionPatch" == 0 ]]; then
226-
echo "New minor version — ensuring branch $TAG points at ${GITHUB_SHA}"
226+
echo "New minor version — ensuring branch $TAG exists"
227227
git config --global user.email christoph.dinh@mne-cpp.org
228228
git config --global user.name chdinh
229229
if git ls-remote --exit-code --heads origin "$TAG" >/dev/null 2>&1; then
230-
echo "Branch $TAG already exists — fast-forwarding it to ${GITHUB_SHA}"
231-
git push origin "${GITHUB_SHA}:refs/heads/$TAG"
230+
echo "Branch $TAG already exists — leaving it unchanged"
232231
else
233232
git checkout -b "$TAG"
234233
git push origin "refs/heads/$TAG"

0 commit comments

Comments
 (0)