Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
git-branch

GitHub Action

Delete multiple branches

v3.0.2

Delete multiple branches

git-branch

Delete multiple branches

Delete multiple branches from repository

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Delete multiple branches

uses: dawidd6/[email protected]

Learn more about this action in dawidd6/action-delete-branch

Choose a version

Delete multiple branches GitHub Action

An action that deletes multiple branches from repository. Optionally one can provide a prefix or suffix strings that would be appended or prepended to every branch name.

Usage

Do not specify numbers and branches together when prefix or suffix are set.

- name: Delete PRs head branches
  uses: dawidd6/action-delete-branch@v3
  with:
    github_token: ${{github.token}}
    numbers: 13,22,${{github.event.pull_request.number}}
- name: Delete pr-* branches
  uses: dawidd6/action-delete-branch@v3
  with:
    github_token: ${{github.token}}
    branches: 13,22,33
    prefix: pr-
- name: Delete branch
  uses: dawidd6/action-delete-branch@v3
  with:
    github_token: ${{github.token}}
    branches: test
    suffix: -done