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 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
f4ce7910dc
commit
863aba8877
@@ -8,7 +8,8 @@ on:
|
|||||||
dry_run:
|
dry_run:
|
||||||
description: 'Dry run (no changes made)'
|
description: 'Dry run (no changes made)'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cleanup-stale-branches:
|
cleanup-stale-branches:
|
||||||
@@ -27,7 +28,7 @@ jobs:
|
|||||||
- name: Find and clean stale release branches
|
- name: Find and clean stale release branches
|
||||||
id: stale
|
id: stale
|
||||||
env:
|
env:
|
||||||
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
|
DRY_RUN: ${{ github.event.inputs.dry_run || false }}
|
||||||
run: |
|
run: |
|
||||||
DAYS=14
|
DAYS=14
|
||||||
|
|
||||||
@@ -43,11 +44,13 @@ jobs:
|
|||||||
# Check if branch has been merged into main
|
# Check if branch has been merged into main
|
||||||
if git merge-base --is-ancestor "$branch" main 2>/dev/null; then
|
if git merge-base --is-ancestor "$branch" main 2>/dev/null; then
|
||||||
echo "Merged branch found: $branch (age: ${age_days}d)"
|
echo "Merged branch found: $branch (age: ${age_days}d)"
|
||||||
if [ "$DRY_RUN" != "true" ]; then
|
if [ "$DRY_RUN" == "true" ]; then
|
||||||
echo "Deleting merged branch: $branch"
|
|
||||||
git push origin --delete "$branch"
|
|
||||||
else
|
|
||||||
echo "Would delete merged branch: $branch"
|
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
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user