Add workflows for closing and deleting branches on PR merge

This commit is contained in:
2025-12-23 11:16:38 +03:00
parent e7c2dfb82e
commit 7826a5df62
3 changed files with 65 additions and 12 deletions

View File

@@ -38,15 +38,3 @@ jobs:
echo "Branch created: $BRANCH_NAME"
fi
- name: Delete branch on issue close
if: github.event.action == 'closed'
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
echo "Searching branches for issue-${ISSUE_NUMBER}-*"
for branch in $(git ls-remote --heads origin | grep "refs/heads/issue-${ISSUE_NUMBER}-" | awk '{print $2}' | sed 's|refs/heads/||'); do
echo "Deleting branch: $branch"
git push origin --delete "$branch" || echo "Failed to delete $branch"
done