Skip to content

chore: delete the branch of a pull request closed without merging - #6

Merged
dignajar merged 1 commit into
mainfrom
chore/delete-branch-on-close
Nov 29, 2026
Merged

dignajar merged 1 commit into
mainfrom
chore/delete-branch-on-close

Conversation

@dignajar

Copy link
Copy Markdown
Member

Problem

Automatically delete head branches only acts on merged pull requests. A pull request closed without merging leaves its branch behind.

Changes

  • cleanup.yml runs on pull_request_target: closed and, when the pull request was not merged, deletes its branch.
  • Only branches of this repository, never main or index, and a fork keeps its branch. Nothing from the pull request is checked out or run, so the write token never touches its code.

- GitHub deletes the branch of a merged pull request, this covers the closed ones
- only branches of this repository, a fork keeps its branch
@dignajar
dignajar merged commit 3a9ebe8 into main Nov 29, 2026
@dignajar
dignajar deleted the chore/delete-branch-on-close branch November 29, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant