delete_head_branch๐
The delete_head_branch
action deletes the head branch of the pull request,
that is the branch which hosts the commits. This only works if the branch is
stored in the same repository that the pull request target, i.e., if the pull
request comes from the same repository and not from a fork.
Note
The action will only happen if and when the pull request is closed or merged.
Options๐
Key Name |
Value Type |
Default |
Value Description |
---|---|---|---|
|
Boolean |
|
If set to |
Examples๐
โ๏ธ Deleting Merged Branch๐
It is common to create pull request from the same repository using different branches โ rather than creating a pull request from a fork. It tends to leave a lot of useless branch behind when the pull request is merged.
Mergify allows to delete those branches once the pull request has been merged:
pull_request_rules:
- name: delete head branch after merge
conditions:
- merged
actions:
delete_head_branch: