Skip to content

[ai] fix(ci): Branch Cleanup workflow fails on stale batch (unsupported script argument) #1839

Description

@github-actions

Problem

The Branch Cleanup workflow (.github/workflows/branch-cleanup.yml) accepts
batch: stale as a workflow_dispatch choice, and its sentinel-commit path
also parses [run-cleanup:stale]. But scripts/maintenance/branch-cleanup-delete.sh
only implements a case for safe|review and falls through to
usage: ... {safe|review} with exit 2 for any other argument — including
stale.

Evidence

Every historical Branch Cleanup run that selected the stale batch has
failed with the same signature, going back to at least 2026-08-07 and as
recently as 2026-09-09 (run
https://github.com/groupthinking/EventRelay/actions/runs/34392035516):

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

At least 15 runs over the last 5 weeks show this same failure with no
remediation.

Fix

Add a STALE_BRANCHES array (currently empty, since
docs/branch-cleanup-matrix.csv has no CLOSE-STALE verdict rows yet) and a
matching stale) case, so the stale batch runs as a documented no-op
instead of erroring out. This keeps the workflow usable for future audits
that do produce CLOSE-STALE branches, without deleting anything today.

Generated by pr-iteration-loop for #1778 · copilot · auto · 98.5 AIC · ⌖ 20.8 AIC · ⊞ 12.1K ·

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

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions