Need help with branch-cleanup-action?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jessfraz
428 Stars 58 Forks MIT License 25 Commits 6 Opened issues

Description

A GitHub action to automatically delete the branch after a pull request has been merged.

Services available

!
?

Need anything else?

Contributors list

# 931
Docker
Perl
Bash
Lua
8 commits
# 37,242
Objecti...
viewcon...
cpluspl...
travis
3 commits
# 219,211
PHP
Symfony
hybrid-...
multi-c...
2 commits
# 253,111
Spring
spring-...
Kotlin
Postgre...
2 commits
# 106,690
seccomp
Bash
Common ...
Lua
1 commit
# 141,958
probot-...
HTML
task-qu...
github-...
1 commit
# 133,966
nginx
google-...
openssh
Sass
1 commit
# 8,154
PHP
dotfile...
Symfony
wirefra...
1 commit
# 95
Python
tpu
robotfr...
apache-...
1 commit
# 510,945
Shell
1 commit

Branch Cleanup Action

Travis CI

A GitHub action to automatically delete the branch after a pull request has been merged. Here's a blog post describing this action in more detail.

NOTE: This will never delete the repository's default branch or protected branches. If the pull request is closed without merging, it will not delete it.

Table of Contents

Usage

workflow "on pull request merge, delete the branch" {
  on = "pull_request"
  resolves = ["branch cleanup"]
}

action "branch cleanup" { uses = "jessfraz/[email protected]" secrets = ["GITHUB_TOKEN"] }

If you include this in another Workflow, you may want to configure the environment variable

NO_BRANCH_DELETED_EXIT_CODE
. The default value for this is
78
, as Github Actions will mark a check as "neutral" (neither failed/succeeded) when you exit with code 78. This will however cancel any other actions running in parallel in this workflow.

If you don't want it to cancel, configure your workflow as follows:

action "branch cleanup" {
  uses = "jessfraz/[email protected]"
  secrets = ["GITHUB_TOKEN"]

env = { NO_BRANCH_DELETED_EXIT_CODE = "0" } }

demo

Contributing

Running the tests

The tests use shellcheck. You don't need to install anything (assuming you have docker installed). The tests run in a container.

$ make test

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.