概要
GitHubでマージ済みだが削除されていないブランチを削除するRuboty Plugin, ruboty-byebranch を作った
用途
GitHub Flow を利用していて、トピックブランチを作成し、Pull Request を出したあと
マージ済みのブランチを削除し忘れて気がついたらブランチのリストが増えてしまっている。
そんな時手動で消すことに頼るのはめんどくさい。
そこで、マージ済みのブランチを削除する ruboty-byebranch を作成しました。
ruboty-byebranch はマージ済みブランチを削除する機能だけを提供し、定期実行は ruboty-cron に任せます。
Installation
Add this line to your application's Gemfile:
gem 'ruboty-byebranch'
And then execute:
$ bundle
Commands
Command | Pattern | Description |
---|---|---|
byebranch | /byebranch (?<user>.+?) (?<repository>.+?) (?<exclude_branches>.+?)\z/ | Delete merged branches |
Usage
byebranch
https://github.com/tbpgr/eto をターゲットとした場合の例
- Delete merged branches
@ruboty byebranch tbpgr eto master,release
success delete branch - test
success delete branch - test2
@ruboty byebranch tbpgr eto master,release
target branch is not exist.
ENV
Name | Description |
---|---|
GITHUB_USER | GitHub USER |
GITHUB_TOKEN | GitHub API Token |
Dependency
Nothing
メモ
この Plugin の作成およびこの記事の作成には以下の gem を利用しています