Skip to content

[ai] Branch Cleanup workflow_dispatch batch=stale always fails (exit 2) #1834

Description

@github-actions

Problem

.github/workflows/branch-cleanup.yml offers a stale batch option in both its workflow_dispatch input (options: [safe, stale, review]) and its push-sentinel regex ([run-cleanup:safe|stale|review]), but scripts/maintenance/branch-cleanup-delete.sh only implements safe and review (there is no STALE_BRANCHES array, and docs/branch-cleanup-matrix.csv has no STALE verdict — only KEEP, CLOSE-SAFE, REVIEW).

Selecting stale always falls through to the script's *) usage branch and exits 2, failing the run.

Evidence

  • Failing run: https://github.com/groupthinking/EventRelay/actions/runs/34392035516 (workflow_dispatch, batch=stale, dry_run=1), exit code 2:
    usage: scripts/maintenance/branch-cleanup-delete.sh {safe|review}   (prefix DRY_RUN=1 to preview)
    ##[error]Process completed with exit code 2.
    
  • scripts/maintenance/branch-cleanup-delete.sh case statement only handles safe/review:
    case "${1:-}" in
      safe)   for b in "${SAFE_BRANCHES[@]}";   do archive_and_delete "$b"; done ;;
      review) for b in "${REVIEW_BRANCHES[@]}"; do archive_and_delete "$b"; done ;;
      *) echo "usage: $0 {safe|review}   (prefix DRY_RUN=1 to preview)"; exit 2 ;;
    esac

Fix

Remove the unimplemented stale option from both trigger paths in branch-cleanup.yml (dispatch options: and the sentinel regex/sed), so the UI/sentinel only ever offers batches the script supports.

Generated by pr-iteration-loop · copilot · auto · 165.9 AIC · ⌖ 9.04 AIC · ⊞ 12.1K ·

  • expires on Sep 16, 2026, 7:04 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