This action manages pull request integrations by allowing a structured workflow to be defined.
The workflow can use required labels, blocking labels, and require that reviewers sign-off for determining if a pull request should be integrated. By default the pull request will be blocked by incomplete/failing checks.
Once conditions are met the pull request will be integrated and branch deleted.
Runs in test mode and will comment rather than merge. This allows you to experiment with the settings without integrating a pull request. Default is false
.
Reviewers required, and reviewers must all approve. This enforces a reviewer mode where there cannot be any pending reviews and the submitted reviews must be in an "approved" state. Default is true
.
One or more labels required for integration. Default is "ready"
.
One or more labels that block the integration. Default is "do not merge"
.
All checks must be completed to be eligible to integrate (this does not include the currently running Action). Note, if triggering multiple runs simultaneously (like adding two labels) this will not pass -- USE WITH CAUTION. Default is false
.
Merge method to use. Possible values are merge
, squash
or rebase
. Default is merge
.
Delete the source branch of the pull request after merging. Set to false
when "Automatically delete head branches" is enabled on your repo. Default is true
.
NOTE: if enabled, merge-bot is unable to delete a branch from a fork.
You can use PR Merge Bot by configuring a YAML-based workflow file, e.g. .github/workflows/merge-bot.yml
.
name: Merge Bot
on:
pull_request:
types:
- labeled
- ready_for_review
- review_request_removed
- review_requested
- synchronize
- unlabeled
pull_request_review:
types:
- dismissed
- submitted
jobs:
merge:
runs-on: ubuntu-latest
name: Merge
steps:
- name: Integration check
uses: squalrus/merge-bot@v0.1.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test: true
reviewers: true
labels: ready, merge
blocking_labels: do not merge
checks_enabled: true
method: squash
delete_source_branch: true