Skip to content

Latest commit

 

History

History

README.md

auto-merge License: GPL v3 npm version

Automatically merge (and optionally approve) all GitHub PRs which match a specific pattern.

Prerequisites

Installation

ℹ️ This is a pure ESM module.

Run yarn global add @ffflorian/auto-merge or npm i -g @ffflorian/auto-merge.

Usage

CLI

Usage: auto-merge [options]

Automatically merge (and optionally approve) all GitHub PRs which match a
specific pattern.

Options:
  -a, --approve        approve before merging
  -c, --config <path>  specify a configuration file (default: .automergerc.json)
  -d, --dry-run        don't send any data
  -s, --squash         squash when merging (default: false)
  -V, --version        output the version number
  -h, --help           display help for command

Configuration file

To use a configuration file, add a configuration file following the cosmiconfig standard (e.g. .automergerc.json) to your project and the auto-merge will find it automatically. Options from the CLI still take precedence over the configuration file.

The structure of the configuration file is the following:

{
  /** The GitHub auth token (needs read and write access to repository and pull requests) */
  authToken?: string;
  /** Approve before merging */
  autoApprove?: boolean;
  /** Don't send any data */
  dryRun?: boolean;
  /** All projects to include */
  projects: {
    /** All projects hosted on GitHub in the format `user/repo` */
    gitHub: string[];
  };
  /** Squash when merging */
  squash?: boolean;
}

If you would like to use a custom configuration file, start the CLI with the option --config <file>.

Configuration file examples