Skip to content

[ai] Branch Cleanup workflow fails when stale batch is selected (dead option, exit code 2) #1836

Description

@github-actions

Bug: Branch Cleanup workflow fails when stale batch is selected

.github/workflows/branch-cleanup.yml still exposes a stale option in both:

  • the workflow_dispatch.inputs.batch choice list ([safe, stale, review]), and
  • the push-sentinel regex (\[run-cleanup:(safe|stale|review)\])

but scripts/maintenance/branch-cleanup-delete.sh only implements case "${1:-}" in safe|review|*) — there is no STALE_BRANCHES array and no stale) case. Per docs/branch-cleanup-followups.md, the 30 CLOSE-STALE branches were already archived+deleted on 2026-06-02, so the array was intentionally dropped from the script — but the workflow wasn't updated to match.

Evidence: run 33689347799 (Security Scan, unrelated) plus the reproducible failure observed on run 34392035516 (Branch Cleanup, dry_run=1, batch=stale):

usage: scripts/maintenance/branch-cleanup-delete.sh {safe|review}   (prefix DRY_RUN=1 to preview)
##[error]Process completed with exit code 2.

Any manual dispatch or push-sentinel using stale fails immediately with exit code 2, even in dry-run mode.

Fix

Remove the dead stale option from the workflow (dispatch choices + sentinel regex + doc comments), since the underlying batch no longer exists in the delete script and its work is already done. This keeps the workflow's advertised options in sync with what the script actually supports, preventing confusing "usage" failures on every stale-batch invocation.
Related to #1827

Generated by pr-iteration-loop for #1827 · copilot · auto · 88.5 AIC · ⌖ 17.2 AIC · ⊞ 12.1K ·

  • expires on Sep 16, 2026, 7:05 PM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions