Validating fixes
Use required CI and optional build validation to check Merget’s fixes before merging.
On this page
A prepared fix and a tested fix are different things. The run's Verification section tells you whether your CI or Merget's own build verified the result, and explains any not verified outcome.
Two ways to verify a fix
| Your CI | Merget's own build | |
|---|---|---|
| Availability | Default for published fixes in Queue and Autonomous modes when Merget's build did not verify them. | Opt-in per repository. |
| What runs | Your workflows on a temporary merget/queue/** branch. | Your configured or discovered setup, build and test commands, in an isolated build environment. |
| When | After the fix is published to the pull request. | Before an accepted fix is published. |
| If it fails | The pull request is blocked; the published fix stays on its branch for inspection. | The failed result is not accepted; if no acceptable fix remains, preparation is blocked. |
| If it cannot run | The run can proceed not verified, with the reason. | The report explains why and Merget can use your CI instead. |
A fix verified by Merget's own build does not also need a staged CI verification. The pull request's own required checks and reviews still apply to its new head. Testing a combination of queued pull requests is covered separately by Batching.
Turn on Merget's own build
Open Repositories and click Configure.
Under Advanced, open Build and test setup.
Set Merget's own build to Auto (discover the repository's commands) for automatic discovery, or to Custom recipe and fill in the form with the fields described below.
Click Save.
This requires Maintain or Admin access on GitHub. Setting it back to Off removes the saved recipe, so enter it again if you later choose Custom recipe.

Open a group under Advanced to change what is in it.
What to look for
- Merget's own build is Off by default; choose Auto to discover your commands, or Custom recipe to write them.
- Validation secrets for private registries are in the same group.
Recipe forms
The recipe is the commands Merget should run. In the drawer, Merget's own build offers Auto, which discovers them, and a Custom recipe form; the setting is saved in one of the forms below, which the form writes for you and which a script can send through the API.
Discover automatically
With Merget's own build set to Auto, Merget works out the build and test commands from your repository. The run's Validation section shows what was selected. If nothing usable is found, set commands explicitly or let your CI verify the fix.
Off
Set Merget's own build to Off, the default. Merget runs none of your recipe's commands; published fixes use the CI path described below. A regenerate command under Generated files still runs for a trusted commit when a merge needs its files rebuilt, and your CI verifies the fix it produces like any other.
One build command
{"Build": "cargo build --workspace"}Runs a build command from the repository root. Use a full recipe if dependencies need an install step. In the drawer, this is a Custom recipe with only a Build command and no ecosystem.
One test command
{"Test": "npm test"}Runs a test command from the repository root. Dependencies must already be available, or supplied through a full recipe. In the drawer, this is a Custom recipe with only a Test command and no ecosystem.
The full recipe
{
"Recipe": {
"ecosystem": "node",
"cwd": "services/api",
"setup": ["npm ci"],
"build": "npm run build",
"test": "npm test",
"env": {"CI": "true"}
}
}| Field (in the drawer's form) | What to enter |
|---|---|
ecosystem (Ecosystem) | rust, node, python, go, java, dotnet or make. Java also covers Kotlin and Scala projects using Maven or Gradle. |
cwd (Working directory) | Optional working directory inside the repository. Defaults to the root. |
setup (Setup commands, one per line) | Optional list of install or preparation commands, in order. This is where validation secrets are available. |
build (Build command) | Optional build command. |
test (Test command) | Optional test command. At least one of build and test is required. |
env (Environment variables) | Optional environment variables for the recipe. Store credentials as validation secrets, not in this field. |
toolchain | Optional required tools, for example [{"tool":"cmake","source":"settings"}]. Set through the API; the drawer's form keeps it when you change the other fields. |
For a Rust workspace, use cargo fetch in setup, cargo check --workspace --all-targets for the build and cargo test --workspace for tests. For Go, use go mod download, go build ./... and go test ./....
The drawer refuses a recipe the server would refuse before saving: one without a build or test command, or one that needs an ecosystem and names none. See Validation secrets for private registries.
How a recipe runs
Merget runs setup, then build, then tests against a clean checkout of the prepared result. Commands must work from the configured directory without relying on your local files or GitHub Actions-only services.
A build or test that rewrites a committed file is rejected: commit generated changes beforehand, or adjust the command. Untracked build output is allowed. Each command has a time limit; a missing tool, failed setup or command timeout is reported as a build that could not run.
Merget's build does not provide submodule contents or Git LFS file contents. A .gitattributes export-ignore rule does not narrow Merget's build: every committed file is present. See Build limits.
What Merget discovers
Automatic discovery takes build and test commands from your GitHub Actions workflows or from your package manifests. The run page names the source it used.
It cannot reproduce every workflow. Jobs that depend on a container, service, CI-only expression or secret, or that do not run on Linux, may not provide a usable recipe. Review the selected commands on the run page and set an explicit recipe if they do not represent the checks you need.

Check whether the prepared result was validated and whether the fix was published.
What to look for
- Validation says which result passed; publication identifies the pushed commit.
- Compare changes opens the source-to-prepared difference for review.
Verification through your CI
Merget can publish a prepared fix to the pull request and stage the same commit on a temporary queue branch so your workflows test it. This is the default when Merget's own build is off or cannot verify it.
What it needs
Workflows that run on pushes to
merget/queue/**. See Make CI run on batch branches.Required checks on the target branch, or names listed under Required CI checks (Advanced › CI integration in the repository's settings). Merget's own check is not a build or test.
A fork's code is not staged on a branch in the main repository, and a fork's commit is prepared only after a maintainer approves it. Stacked pull requests and fixes held only in a queue candidate also have different publication paths; the run says what is waiting to be verified.
What happens
Merget publishes a fix to the pull request branch.
It stages the commit under
merget/queue/**for your workflows.The Merget check stays In progress, the queue reads Fix pushed · waiting for your CI, and the run reads Waiting for your CI.
CI validation on the run links to the staged commit's checks and shows the timeout.
When required checks pass, the pull request returns to its queue verdict. A failed required check blocks it.
The temporary branch is removed after verification ends. CI timeout (seconds), under Advanced › CI integration, also controls this wait when batching itself is off.
Outcomes
| Result | What happens |
|---|---|
| Required checks pass | The run records verification by your CI; the pull request continues in queue order. |
| A required check fails | Preparation is blocked. Open the linked failure, correct the branch and push. |
| No check is required | There is no CI gate to ask; the result can proceed not verified. |
| Checks do not report before the timeout | The result can proceed not verified, with the missing result explained. |
| The pull request or target changes | The older work goes out of date and Merget prepares the new state. If pull requests queued ahead of it merge as Merget predicted, that is no such change, and the wait goes on. |
Not verified must not be read as a passing build. Require the checks you need and ensure they run on queue branches. GitHub's own pull request checks and reviews remain separate requirements.
Private dependencies
For private GitHub dependencies, include their repositories in the same Merget GitHub App installation and have a GitHub admin of each dependency grant access under the consuming repository's Build and test setup › Dependency access. The dependency must also be named by the target branch's manifests. See Dependency access. For private package registries, add credentials under Validation secrets and use them in a recipe setup command. If an owner supplies an organization secret, this repository must be included in its Delivered to selection. Fork pull requests receive no validation secrets. A bot's pull request receives them only after a maintainer approves its commit, unless the bot is listed under Trusted bots (Pull requests from forks and bots).
The run explains which dependency could not be fetched. Correct its access and request a new preparation. See Private dependencies for the setup steps.
Troubleshooting
| What you see | What to do |
|---|---|
| No build or test recipe discovered | Leave verification to CI or set a recipe representing your build and tests. |
| Toolchain missing or setup failed | Check the named command and whether it works in a clean checkout. Use a supported alternative or contact support for an unavailable tool. |
| Private dependency cannot be read | Check App access and the dependency's explicit grant in Dependency access; for a private registry, configure a validation secret. See Private dependencies. |
| Validation rewrote tracked files | Commit the generated output or stop the build/test step rewriting committed files. |
| CI did not report | Check the merget/queue/** push trigger and exact required check names; adjust the timeout if necessary. |
| Your CI failed on the fix | Open the linked check, fix the branch and push. The existing published fix remains available for review. |
After correcting setup or a temporary failure, use Retry preparation.