fix: add explicit default case to the workflow-ship branch guard

This commit is contained in:
davotoula
2026-07-29 14:13:51 +02:00
parent 52a8cc338a
commit 4700e51d82
2 changed files with 4 additions and 0 deletions
@@ -28,6 +28,8 @@ cd "$BUZZ_WORKTREE" || die "cannot cd into worktree $BUZZ_WORKTREE"
base_branch="$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo main)"
case "$BUZZ_BRANCH" in
"$base_branch" | main | master) die "refusing to operate on the default branch ($BUZZ_BRANCH)" ;;
# Anything else is a per-run branch — the only thing this script is allowed to push.
*) : ;;
esac
title="$(git log -1 --format='%s' 2>/dev/null | cut -c1-72)"
+2
View File
@@ -28,6 +28,8 @@ cd "$BUZZ_WORKTREE" || die "cannot cd into worktree $BUZZ_WORKTREE"
base_branch="$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo main)"
case "$BUZZ_BRANCH" in
"$base_branch" | main | master) die "refusing to operate on the default branch ($BUZZ_BRANCH)" ;;
# Anything else is a per-run branch — the only thing this script is allowed to push.
*) : ;;
esac
title="$(git log -1 --format='%s' 2>/dev/null | cut -c1-72)"