Skip to content

delete-merged-action

Actions
Automatically delete merged branches (highly configurable)
v1.2.4
Latest
Star (3)

🗑️🎬 Delete Merged Action

GitHub Action to automatically delete merged branches, with a highly configurable branches option.

Build CI Test CI Release CI Node CI

⚙️ Usage

You might not need this action, because GitHub natively supports deleting merged branches. However, you can configure exactly which branches to delete using this action. It also works well for GitHub Free accounts that don't support protected branches.

Inputs

branches

Glob rules for names of branches to delete, defaults to !master, !main, *

Environment variables

GITHUB_TOKEN (required)

GitHub token to delete branches: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example

name: Merge PRs
on:
  pull_request:
    types:
      - opened
      - closed
      - edited
      - reopened
jobs:
  automerge:
    runs-on: ubuntu-latest
    steps:
      - name: Delete merged branch
        uses: koj-co/delete-merged-action@master
        with:
          branches: "!master, !production, *"
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

📄 License

  • Code: MIT © Koj
  • "GitHub" is a trademark of GitHub, Inc.

Koj

An open source project by Koj.
Furnish your home in style, for as low as CHF175/month →

delete-merged-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Automatically delete merged branches (highly configurable)
v1.2.4
Latest

delete-merged-action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.