---
title: Delete Head Branch (Deprecated)
description: Delete pull request head branch. Deprecated in favor of GitHub's built-in "Automatically delete head branches" setting.
---

:::danger
  The `delete_head_branch` action is **deprecated** and will be removed in a
  future release. Use GitHub's built-in
  [Automatically delete head branches][gh-auto-delete] setting instead.
:::

The action deletes a pull request's head branch once the pull request is closed.
Turn on [Automatically delete head branches][gh-auto-delete] in your repository
settings and drop the action from your rules.

## Parameters

| Key name | Value type | Default | Description |
| --- | --- | --- | --- |
| `force` | boolean | `false` | If set to `true`, the branch will be deleted even if another pull request depends on the head branch. GitHub will therefore close the dependent pull requests. |

[gh-auto-delete]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches
