Giter Club home page Giter Club logo

gomerge's Introduction

gomerge

GitHub Actions Status GitHub Actions Status Downloads

Gomerge logo

Description

Gomerge is a tool to quickly enable you to bulk merge and/or approve Github pull requests from your terminal. The intention of this tool is to simplfy merging large numbers of Github pull requests, as they can certainly grow when you're maintaining a large number of repositories (Ahem, dependabot!). This tool should be able to run on most systems.

Requirements

You must have created a github personal access token (PAT) to use this tool. For information on how to do so, you can follow the documentation https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token

Gomerge Demo

Install

To install the latest version via homebrew, please run the following.

brew tap Cian911/gomerge
brew install gomerge

// Check the binary is working as expected.
gomerge -h

To install the compiled binary, you can go to the releases tab, and download the version most suitable to your environment. An example of such is below.

wget https://github.com/Cian911/gomerge/releases/download/2.2.0/gomerge_2.2.0_Linux_x86_64.tar.gz
sudo tar -xvf gomerge_2.2.0_Linux_x86_64.tar.gz -C /usr/local/bin/
sudo chmod +x /usr/local/bin/gomerge
Upgrade

If you have the tool installed already via homebrew, you can upgrade by running the following:

brew upgrade gomerge

Usage

Below denotes the available commands and flags on the gomerge tool.

Gomerge makes it simple to merge an open pull request from your terminal.

Usage:
  gomerge [command]

Available Commands:
  help        Help about any command
  list        List all open pull request for a repository you wish to merge.
  version     Prints the current version and build information.

Flags:
  -a, --approve               Pass an optional approve flag as an argument which will only approve and not merge selected repos.
  -c, --config string         Pass an optional config file as an argument with list of repositories.
  -h, --help                  help for gomerge
  -m, --merge-method string   Pass an optional merge method for the pull request (merge [default], squash, rebase).
  -r, --repo string           Pass name of repository as argument (organization/repo).
  -t, --token string          Pass your github personal access token (PAT).

Use "gomerge [command] --help" for more information about a command.

To get a list of open and active pull requests for a given repo, you can run the following command. Note, this will list all available PRs for merging, if you want to just approve a list of PRs, then add the -a to the below command too.

N.B: Please ensure to add your organization followed by the name of your repository. In most cases this will be your github username, but if referencing a repository that exists within an organization you have access to, be sure to substitute it for that E.G google/example-repo.

gomerge list -r Cian911/gomerge -t ${GITHUB_TOKEN}

Something to note, if you have your github token defined as an environment variable in the following format GITHUB_TOKEN, gomerge will try and use that automagically if you choose not to define a token via a flag. Thanks to @caioeverest for this work!

If there are any active and open pull requests for your given repository, you will see an output similar to below.

gomerge Sample Output

From here, follow the instructions to select which pull request you wish to merge, and hit enter. Your pull request should now have been merged, and you should get a similar message to below.

PR #3: Pull Request successfully merged.
Bulk Merging/Approving Pull Requests

You should first create a config.yaml file in the following format.

organization: Cian911
repositories:
- pr-test
- syncwave

You can then run the tool like so, passing the config file as a flag.

gomerge list -t $GITHUB_TOKEN -c config.yaml

And again, if you just wish to approve a list of available PRs, just add the -a flag like so.

gomerge list -t $GITHUB_TOKEN -c config.yaml -a

You should see a list of active and open pull requets from the repositories you have defined in your configuration file.

gomerge Bulk Output Sample

gomerge's People

Contributors

caioeverest avatar cian911 avatar hiroebe avatar mlaccetti avatar

Watchers

 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.