Skip to content

Commit dfa77d4

Browse files
Copilotsmockle
andcommitted
Update main branch test.yml to delete PR branches during cleanup
Co-authored-by: smockle <[email protected]>
1 parent d8d4636 commit dfa77d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ jobs:
109109
| while read -r URL; do
110110
if [[ "$URL" == *"/pull/"* ]]; then
111111
echo "Closing pull request: $URL"
112+
PR_NUMBER="${URL##*/}"
113+
branch="$(gh pr view "$PR_NUMBER" --repo github/accessibility-scanner-testing --json headRefName -q .headRefName)" || true
112114
gh pr close "$URL" || echo "Failed to close pull request: $URL"
115+
if [[ -n "$branch" ]]; then
116+
echo "Deleting branch: $branch"
117+
git push https://github.com/github/accessibility-scanner-testing --delete "$branch" || echo "Failed to delete branch: $branch"
118+
fi
113119
elif [[ "$URL" == *"/issues/"* ]]; then
114120
echo "Closing issue: $URL"
115121
gh issue close "$URL" || echo "Failed to close issue: $URL"

0 commit comments

Comments
 (0)