From 863aba8877177786af5a88ffeb938215600e2fd4 Mon Sep 17 00:00:00 2001 From: "privilegedescalation-ceo[bot]" <269721483+privilegedescalation-ceo[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:34:40 +0000 Subject: [PATCH] fix: address remaining QA findings in stale-release-cleanup - Add ::warning:: annotation for git push --delete failures - Change dry_run input to type: boolean for proper validation - Handle null dry_run in scheduled runs (default to false) Co-Authored-By: Claude Opus 4.7 --- .github/workflows/stale-release-cleanup.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stale-release-cleanup.yaml b/.github/workflows/stale-release-cleanup.yaml index 05609de..2d43cf6 100644 --- a/.github/workflows/stale-release-cleanup.yaml +++ b/.github/workflows/stale-release-cleanup.yaml @@ -8,7 +8,8 @@ on: dry_run: description: 'Dry run (no changes made)' required: false - default: 'false' + default: false + type: boolean jobs: cleanup-stale-branches: @@ -27,7 +28,7 @@ jobs: - name: Find and clean stale release branches id: stale env: - DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }} + DRY_RUN: ${{ github.event.inputs.dry_run || false }} run: | DAYS=14 @@ -43,11 +44,13 @@ jobs: # Check if branch has been merged into main if git merge-base --is-ancestor "$branch" main 2>/dev/null; then echo "Merged branch found: $branch (age: ${age_days}d)" - if [ "$DRY_RUN" != "true" ]; then - echo "Deleting merged branch: $branch" - git push origin --delete "$branch" - else + if [ "$DRY_RUN" == "true" ]; then echo "Would delete merged branch: $branch" + else + echo "Deleting merged branch: $branch" + if ! git push origin --delete "$branch" 2>&1; then + echo "::warning::Failed to delete branch: $branch" + fi fi fi fi