Giter Site home page Giter Site logo

kmaqsudi / branch-cleanup-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jessfraz/branch-cleanup-action

0.0 1.0 0.0 675 KB

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

License: MIT License

Dockerfile 10.00% Makefile 16.44% Shell 73.56%

branch-cleanup-action's Introduction

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

branch-cleanup-action's People

Contributors

jessfraz avatar fbartho avatar toc-me[bot] avatar jonasjurczok avatar seiffert avatar houghio avatar hkdobrev avatar sburns avatar mrwacky42 avatar cclauss avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.