All Projects → SvanBoxel → Delete Merged Branch

SvanBoxel / Delete Merged Branch

Licence: isc
No more manually deleting merged branches, this lovely app does it for you.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Delete Merged Branch

probot-messages
Probot extension for communicating with repository maintainers
Stars: ✭ 13 (-94.92%)
Mutual labels:  probot
commands
A Probot extension that adds slash commands to GitHub
Stars: ✭ 54 (-78.91%)
Mutual labels:  probot
probot-issue-duplicate-detection
A probot plugin for automatic issue duplicate detection
Stars: ✭ 31 (-87.89%)
Mutual labels:  probot
probot-ooo
🙅 Respond with an auto-responder when you are OOO
Stars: ✭ 36 (-85.94%)
Mutual labels:  probot
background-check
A GitHub App built with probot that peforms a "background check" to identify users who have been toxic in the past, and shares their toxic activity in the maintainer’s repo.
Stars: ✭ 27 (-89.45%)
Mutual labels:  probot
prosebot
🤖🔊 Probot App to help you write better on GitHub.
Stars: ✭ 46 (-82.03%)
Mutual labels:  probot
scheduler
⚠️ Archived
Stars: ✭ 46 (-82.03%)
Mutual labels:  probot
boring-cyborg
🤖 A Github bot to automatically label PRs, issues and perform all the boring operations that you don't want to do.
Stars: ✭ 66 (-74.22%)
Mutual labels:  probot
linter-alex
📝Sensitive, considerate writing before you merge your Pull Requests
Stars: ✭ 67 (-73.83%)
Mutual labels:  probot
node
npm's fork of nodejs/node, for sending PRs to update deps/npm
Stars: ✭ 30 (-88.28%)
Mutual labels:  probot
dont-merge
Prevent merging of Pull Requests with a custom label selected on labels area.
Stars: ✭ 26 (-89.84%)
Mutual labels:  probot
probot-semver
A GitHub app that provides automatic semantic versioning support
Stars: ✭ 15 (-94.14%)
Mutual labels:  probot
merge-me
A GitHub app that merges your pull requests once all required checks pass.
Stars: ✭ 19 (-92.58%)
Mutual labels:  probot
serverless-gcf
An extension for running Probot on Google Cloud Functions
Stars: ✭ 15 (-94.14%)
Mutual labels:  probot
probot-config
A Probot extension to easily share configs between repositories.
Stars: ✭ 63 (-75.39%)
Mutual labels:  probot
branch-switcher
a GitHub bot that switches the base branch of pull requests to the preferred branch
Stars: ✭ 15 (-94.14%)
Mutual labels:  probot
react-preview
a GitHub App built with probot that generates preview links for react based projects.
Stars: ✭ 14 (-94.53%)
Mutual labels:  probot
auth-routes
🔀🔒 Helpful authentication routes for Node.js GitHub integrations
Stars: ✭ 13 (-94.92%)
Mutual labels:  probot
fyi
Map & Explore your organization's System Architecture
Stars: ✭ 28 (-89.06%)
Mutual labels:  probot
PROBOT Anno
ROS Packages for PROBOT Anno.
Stars: ✭ 75 (-70.7%)
Mutual labels:  probot

delete-merged-branch

Delete merged branch

Build Status Want to see more badges? Click here!

Want to run this app with GitHub Actions? Click here

A GitHub app built with Probot that automatically deletes a branch after it's merged. That's it, enjoy!

🔔 Wait, do you really need this? 🔔

You may not need this app as GitHub recently added this feature natively to their platform. It allows you to automatically delete the head branch after a merge. If you need more advanced controls and configuration settings, this app is still well suited for the job.

Running it locally

  1. First, follow these instructions for making your own GitHub app.

    1. Give your app the following permissions:
      • Repository contents: Read & Write.
      • Pull requests: Read
    2. And Subscribe to the following events
      • Pull Request
  2. Then, clone the repo:

git clone [email protected]:SvanBoxel/delete-merged-branch.git
  1. Copy .env.example to .env and set the right environment variables as here

  2. Now, install app dependencies and run it:

# Install dependencies
npm install

# Run the bot
npm start

How it works

This GitHub app listens to the pull_request.closed webhook. If a pull request is closed and the connected branch is merged, it will delete the branch.

Configuration

The optional app configuration YAML file should be saved as .github/delete-merged-branch-config.yml. At the moment it supports the following options:

  • exclude (array) - list of branches that should not be automatically deleted after a merge. Wildcards supported.
  • delete_closed_pr (bool) whether or not a branch should be deleted if PR is closed without merging

Example .github/delete-merged-branch-config.yml:

exclude: 
  - development
  - qa
  - feature-*
delete_closed_pr: true

Release process

CI (GitHub Actions) is in charge of releasing new versions of the GitHub App to Google Cloud Platform. On every new commit to master we run semantic-release to determine whether the major/minor/patch version should be incremented. If so, we update the version running in production.

Running in GitHub actions

This app is compatible with GitHub Actions. You need to create a workflow that is triggered on the pull_request event for this. Then, you use this repo for the action. (SvanBoxel/[email protected]). Don't forget to check the GITHUB_TOKEN secret. That's it.

name: delete branch on close pr
on: 
  pull_request:
    types: [closed]
  
jobs:
  delete-branch:
    runs-on: ubuntu-latest
    steps:
      - name: delete branch
        uses: SvanBoxel/delete-mer[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Contributing

If you have suggestions for how this GitHub app could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

ISC © 2018 Sebass van Boxel [email protected]

Badges

Build Status codecov Greenkeeper badge Project maintainability npm version Total alerts

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].