Removal of neutral status code (#23)

With the change to YAML and the new CICD oriented actions, we lost the ability to use exit code 78.

This is switching to status code 0 to show success as oppose to a failure on a status check.

https://help.github.com/en/articles/virtual-environments-for-github-actions#exit-codes-and-statuses
1 file changed
tree: 472cbc6c1a77e74af2483465a931cb14622c9d06
  1. .github/
  2. .travis.yml
  3. Dockerfile
  4. LICENSE
  5. Makefile
  6. README.md
  7. cleanup-pr-branch
  8. demo.png
  9. test.sh
README.md

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/branch-cleanup-action@master"
  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/branch-cleanup-action@master"
  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