Skip to content

ci: auto-delete merged PR head branches - #2

Merged
MichalAFerber merged 1 commit into
mainfrom
claude/punctuation-wizard-ncjh66
Aug 22, 2026
Merged

MichalAFerber merged 1 commit into
mainfrom
claude/punctuation-wizard-ncjh66

Conversation

@MichalAFerber

Copy link
Copy Markdown
Owner

Adds a small Actions workflow that deletes a PR's head branch as soon as the PR is merged — the automation equivalent of the repo setting Settings → General → Pull Requests → "Automatically delete head branches" (a settings toggle that can't be flipped via the tools available in my environment, so this workflow stands in for it).

Guards:

  • merged PRs only — a closed-without-merge PR keeps its branch
  • never touches fork branches (head repo must equal this repo)
  • never touches the default branch
  • tolerates a ref that's already gone, so it coexists harmlessly with the native setting if you flip that on later (at which point this workflow can simply be removed)

Self-testing by construction: merging this PR fires the workflow, which should delete claude/punctuation-wizard-ncjh66 — you can watch the run in the Actions tab.

🤖 Generated with Claude Code

https://claude.ai/code/session_017V8qVCQEZFKAkKTByQrMZk


Generated by Claude Code

Actions workflow standing in for the "Automatically delete head branches"
repo setting: on a merged pull_request it deletes the head ref, guarded
against fork branches and the default branch, and tolerant of a ref that
is already gone (so it coexists with the native setting if that is ever
enabled).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017V8qVCQEZFKAkKTByQrMZk
@MichalAFerber
MichalAFerber merged commit 1842664 into main Aug 22, 2026
@github-actions
github-actions Bot deleted the claude/punctuation-wizard-ncjh66 branch August 22, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant