From 9d66257a91c15cf7d374ffb42ca29a40d188ec43 Mon Sep 17 00:00:00 2001 From: Dan Ditomaso Date: Fri, 17 Oct 2025 10:06:08 -0400 Subject: [PATCH] Update .github/workflows/update-stable-from-master.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/update-stable-from-master.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-stable-from-master.yml b/.github/workflows/update-stable-from-master.yml index d6e5a0dc..3de8f0cc 100644 --- a/.github/workflows/update-stable-from-master.yml +++ b/.github/workflows/update-stable-from-master.yml @@ -85,4 +85,11 @@ jobs: - name: Push stable (force-with-lease) run: | # Safer than --force; refuses if remote moved unexpectedly (protects against races) - git push origin stable:stable --force-with-lease=stable + REMOTE_STABLE_SHA="$(git rev-parse refs/remotes/origin/stable || echo '')" + if [ -z "$REMOTE_STABLE_SHA" ]; then + # If remote stable doesn't exist, just use --force-with-lease=stable (no SHA) + git push origin stable:stable --force-with-lease=stable + else + # Use the specific SHA for maximum safety + git push origin stable:stable --force-with-lease=stable:$REMOTE_STABLE_SHA + fi