diff --git a/.github/workflows/cpr-example-command.yml b/.github/workflows/cpr-example-command.yml
index a545dfc..0f55d7a 100644
--- a/.github/workflows/cpr-example-command.yml
+++ b/.github/workflows/cpr-example-command.yml
@@ -34,6 +34,7 @@ jobs:
           milestone: 1
           draft: false
           branch: example-patches
+          delete-branch: true
 
       - name: Check output
         run: |
diff --git a/README.md b/README.md
index 0284222..a369b3d 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
 | `author` | The author name and email address in the format `Display Name <email@address.com>`. Defaults to the user who triggered the workflow run. | `${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>` |
 | `signoff` | Add [`Signed-off-by`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) line by the committer at the end of the commit log message. | `false` |
 | `branch` | The pull request branch name. | `create-pull-request/patch` |
+| `delete-branch` | Delete the `branch` when closing pull requests, and when undeleted after merging. Recommend `true`. | `false` |
 | `branch-suffix` | The branch suffix type when using the alternative branching strategy. Valid values are `random`, `timestamp` and `short-commit-hash`. See [Alternative strategy](#alternative-strategy---always-create-a-new-pull-request-branch) for details. | |
 | `base` | Sets the pull request base branch. | Defaults to the branch checked out in the workflow. |
 | `push-to-fork` | A fork of the checked-out parent repository to which the pull request branch will be pushed. e.g. `owner/repo-fork`. The pull request will be created to merge the fork's branch into the parent's base. See [push pull request branches to a fork](docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork) for details. | |
@@ -88,7 +89,7 @@ How the action behaves:
 - If there are changes (i.e. a diff exists with the checked-out base branch), the changes will be pushed to a new `branch` and a pull request created.
 - If there are no changes (i.e. no diff exists with the checked-out base branch), no pull request will be created and the action exits silently.
 - If a pull request already exists and there are no further changes (i.e. no diff with the current pull request branch) then the action exits silently.
-- If a pull request exists and new changes on the base branch make the pull request unnecessary (i.e. there is no longer a diff between the base and pull request branch), the pull request is automatically closed and the branch deleted.
+- If a pull request exists and new changes on the base branch make the pull request unnecessary (i.e. there is no longer a diff between the pull request branch and the base), the pull request is automatically closed. Additionally, if `delete-branch` is set to `true` the `branch` will be deleted.
 
 For further details about how the action works and usage guidelines, see [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md).
 
@@ -176,6 +177,7 @@ jobs:
           author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
           signoff: false
           branch: example-patches
+          delete-branch: true
           title: '[Example] Update report'
           body: |
             Update report
diff --git a/action.yml b/action.yml
index c306a7b..c169c32 100644
--- a/action.yml
+++ b/action.yml
@@ -27,6 +27,11 @@ inputs:
   branch:
     description: 'The pull request branch name.'
     default: 'create-pull-request/patch'
+  delete-branch:
+    description: >
+      Delete the `branch` when closing pull requests, and when undeleted after merging.
+      Recommend `true`.
+    default: false
   branch-suffix:
     description: 'The branch suffix type when using the alternative branching strategy.'
   base:
diff --git a/dist/index.js b/dist/index.js
index a9aeed8..48bc501 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1405,6 +1405,7 @@ function run() {
                 author: core.getInput('author'),
                 signoff: core.getInput('signoff') === 'true',
                 branch: core.getInput('branch'),
+                deleteBranch: core.getInput('delete-branch') === 'true',
                 branchSuffix: core.getInput('branch-suffix'),
                 base: core.getInput('base'),
                 pushToFork: core.getInput('push-to-fork'),
@@ -7042,16 +7043,19 @@ function createPullRequest(inputs) {
                 yield githubHelper.createOrUpdatePullRequest(inputs, baseRemote.repository, branchRepository);
             }
             else {
-                // If there is no longer a diff with the base delete the branch
+                // There is no longer a diff with the base
+                // Check we are in a state where a branch exists
                 if (['updated', 'not-updated'].includes(result.action)) {
                     core.info(`Branch '${inputs.branch}' no longer differs from base branch '${inputs.base}'`);
-                    core.info(`Closing pull request and deleting branch '${inputs.branch}'`);
-                    yield git.push([
-                        '--delete',
-                        '--force',
-                        branchRemoteName,
-                        `refs/heads/${inputs.branch}`
-                    ]);
+                    if (inputs.deleteBranch) {
+                        core.info(`Deleting branch '${inputs.branch}'`);
+                        yield git.push([
+                            '--delete',
+                            '--force',
+                            branchRemoteName,
+                            `refs/heads/${inputs.branch}`
+                        ]);
+                    }
                 }
             }
         }
diff --git a/src/create-pull-request.ts b/src/create-pull-request.ts
index ce46a36..ae99875 100644
--- a/src/create-pull-request.ts
+++ b/src/create-pull-request.ts
@@ -17,6 +17,7 @@ export interface Inputs {
   author: string
   signoff: boolean
   branch: string
+  deleteBranch: boolean
   branchSuffix: string
   base: string
   pushToFork: string
@@ -194,18 +195,21 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
         branchRepository
       )
     } else {
-      // If there is no longer a diff with the base delete the branch
+      // There is no longer a diff with the base
+      // Check we are in a state where a branch exists
       if (['updated', 'not-updated'].includes(result.action)) {
         core.info(
           `Branch '${inputs.branch}' no longer differs from base branch '${inputs.base}'`
         )
-        core.info(`Closing pull request and deleting branch '${inputs.branch}'`)
-        await git.push([
-          '--delete',
-          '--force',
-          branchRemoteName,
-          `refs/heads/${inputs.branch}`
-        ])
+        if (inputs.deleteBranch) {
+          core.info(`Deleting branch '${inputs.branch}'`)
+          await git.push([
+            '--delete',
+            '--force',
+            branchRemoteName,
+            `refs/heads/${inputs.branch}`
+          ])
+        }
       }
     }
   } catch (error) {
diff --git a/src/main.ts b/src/main.ts
index 7e7b017..157659b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -13,6 +13,7 @@ async function run(): Promise<void> {
       author: core.getInput('author'),
       signoff: core.getInput('signoff') === 'true',
       branch: core.getInput('branch'),
+      deleteBranch: core.getInput('delete-branch') === 'true',
       branchSuffix: core.getInput('branch-suffix'),
       base: core.getInput('base'),
       pushToFork: core.getInput('push-to-fork'),