> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gitar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto-Apply

> Let Gitar push fixes for review findings, limited by criteria you write

export const ThemeImage = ({src, alt, width}) => {
  let lightSrc, darkSrc;
  if (src.includes("-light.")) {
    lightSrc = src;
    darkSrc = src.replace("-light.", "-dark.");
  } else if (src.includes("-dark.")) {
    darkSrc = src;
    lightSrc = src.replace("-dark.", "-light.");
  } else {
    lightSrc = src;
    darkSrc = src;
  }
  const style = width ? {
    maxWidth: width,
    marginInline: "auto"
  } : undefined;
  return <span>
      <img className="block dark:hidden rounded-lg border" src={lightSrc} alt={alt} style={style} />
      <img className="hidden dark:block rounded-lg border" src={darkSrc} alt={alt} style={style} />
    </span>;
};

## Overview

Auto-apply lets Gitar commit fixes for review findings and CI failures to a PR's branch. Organization and repository criteria limit which review findings Gitar may fix.

Turn auto-apply on for a PR with [`gitar auto-apply:on`](/commands#auto-apply) or the [`gitar-managed`](/labels#gitar-managed) label. Saving criteria does not turn auto-apply on for any PR.

## Set Organization Criteria

Write criteria in **Settings -> Configuration** to limit automatic review fixes across the organization.

<ThemeImage src="/assets/images/auto-apply-criteria-light.png" alt="Auto-apply review criteria card with the organization review criteria field and a note on extending it with .gitar/config/apply.md" border={true} />

1. Open **Settings -> Configuration** in the Gitar dashboard.
2. Find the **Auto-apply review criteria** card.
3. Enter criteria under **Organization review criteria**.
4. Select **Save**.

Criteria take effect on each PR's next run. Use natural language to filter by finding severity, issue type, affected code, or [PR risk](/features/code-review/risk-triage). Examples:

* "Only fix unused imports and formatting. Skip payment logic."
* "Only fix minor findings on low-risk PRs."
* "Skip findings in authentication or authorization code."

<Note>
  The fixer cannot run shell commands or tests, so criteria that require passing tests are never met. An unavailable risk assessment does not meet a risk-dependent condition.
</Note>

## Per-Repo Criteria

Add `.gitar/config/apply.md` to extend organization criteria for one repository. When both are present, a fix must satisfy both. Without the file, organization criteria apply on their own.

Gitar reads the file from the default branch, so changes inside a PR cannot authorize that PR's own fixes. See [Repository Customization](/configuration/repository-config) for the `.gitar` directory.

```bash theme={null}
mkdir -p .gitar/config
echo "Skip findings in database migrations." > .gitar/config/apply.md
```

## What Criteria Control

Criteria select fixes for code review findings only. CI fixes, [CI recovery](/features/ci-failure-analysis#recovery-after-a-gitar-fix), rule actions, and explicit requests such as `gitar fix` work independently of these criteria. Auto-approve and auto-merge have separate criteria.

Each run fixes up to eight findings. Gitar checks every patch against the criteria before committing and again before pushing. A rejected patch is dropped without losing earlier accepted fixes, and its finding stays open.

## Results in the Dashboard Comment

When criteria are set and findings have been evaluated, **Options** in the [dashboard comment](/gitar-dashboard) shows a count such as `Auto-apply: 1 / 3 findings fixed`, with reasons for skipped findings. The count includes only fixes pushed to the branch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.