Skip to content

🗑️🎬 GitHub Action to delete merged branches (highly configurable)

License

Notifications You must be signed in to change notification settings

vitaliytv/delete-merged-action

 
 

Repository files navigation

🗑️🎬 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 →

About

🗑️🎬 GitHub Action to delete merged branches (highly configurable)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.5%
  • JavaScript 4.5%