# Stash Latest (2.12) : Checks for merging pull requests

Created and last modified by pwatson on Feb 17, 2014

To help customise your workflow, you can set checks to control when a pull request can be merged. Pull requests cannot be merged if the required checks have not been met. These checks are set separately on each repository in a Stash project.

You'll need either project admin, admin or sys-admin permissions to set merge checks for pull requests.

So, to set merge checks for pull requests, go to a repository in a project and choose Settings > Pull requests. Stash includes the merge checks described below, or you can write your own merge request check plugin.

## Require a number of completed builds

Select this option to stop pull requests from being merged if they have any unsuccessful builds. For a pull request, this checks builds that run against the latest commit on the source branch.

You must also specify a minimum number of builds - the pull request will not be able to be merged until at least this many builds have completed. Ideally, you should set this to the number of different builds that are configured to run against the branches in your repository.

See Bamboo integration for more information about integrating Stash with your build server.

The number of builds, and the latest result, for the head commit of a branch.

## Require a minimum number of approvers

Select this option to block merging of a pull request until it has been approved by at least the selected number of participants.

## Attachments:

STASH22_merge_checks.png (image/png)
STASH22_latest_build.png (image/png)