Skip to main content

Overview

Auto-approve lets Gitar submit an approving review on your behalf after a clean code review. You define criteria in natural language, and if they are met, Gitar approves the PR without any manual action required.

Criteria-Driven

Define approval conditions in natural language, or use the default behavior with no criteria at all

Post-Review Only

Only runs after a clean code review with no blocking findings

Per-Repo Control

Extend org criteria per repository with a config file

How It Works

1

Code review completes

Gitar reviews the PR as usual. Important or critical findings withhold approval. Approval is also withheld when the configured merge blocking threshold includes unresolved suggestions.
2

Criteria are checked

Gitar evaluates your configured criteria against the whole PR, including its changed files and unresolved findings. If no criteria are configured, Gitar approves the PR when the review found no blocking issues.
3

Approval is submitted

Gitar submits an approval on the connected code host. The dashboard comment shows the approval and the rationale.
A skipped or incomplete review does not qualify for auto-approval merely because it reports no findings. Acknowledged findings count as resolved for approval, even without a code fix. Other approval criteria still apply. See Providing feedback for acknowledgement behavior.

Enabling Auto-Approve

Auto-approve is configured in your organization settings:
  1. Navigate to Settings -> Configuration in the Gitar dashboard
  2. Open the Behavior section
  3. Enable the Auto-approve PRs based on code review toggle
  4. Optionally, enter custom approval criteria in the text area that appears
Criteria are written in natural language. Examples:
  • “Only approve if the changes are limited to documentation or test files”
  • “Approve changes to the docs/ directory or files ending in .md”
  • “Skip approval if the PR modifies authentication or payment logic”
Auto-approval criteria are evaluated against the PR metadata, changed files, and code review results, not CI pipeline status. Gitar does not verify conditions like “tests pass” or “linting is green”. Enforce those with your platform’s branch protection or merge checks.Criteria also cannot call integration tools. Naming a Jira, Slack, or custom MCP tool in your criteria does not make its result an approval condition, and results from earlier integration calls are not passed into the evaluation.
If you change auto-approve or merge blocking settings after a review, Gitar requires a fresh review before submitting a pending automatic approval. Turning off auto-approve prevents pending automatic approvals from being submitted. Actions already sent to the code host may still complete.

Use PR risk in criteria

Approval criteria can use Gitar’s whole-PR risk assessment, for example, “Approve only low- or medium-risk changes.” Risk Triage explains the levels and team-defined policy. Risk restricts approval after review. Low risk does not bypass blocking findings, and an unavailable assessment does not meet a risk-dependent condition unless the criteria explicitly allow it.

Require code owner or human approval

On GitHub, criteria can use CODEOWNERS and human reviews. For example:
Gitar reads CODEOWNERS from the PR’s target branch. It checks who owns the changed files and whether each review applies to the current commit. Team ownership requires the GitHub App’s organization Members: read permission. If ownership or review evidence cannot be read, the condition is unmet and Gitar withholds approval. These criteria are unavailable on other code hosts, where they also withhold approval. If the review history is too large to evaluate completely, Gitar withholds criteria-based approval and auto-merge for that run.

Default Behavior (No Criteria)

With the toggle enabled and no criteria in organization settings, configuration repositories, or .gitar/config/approve.md, Gitar approves PRs with no blocking findings. Minor suggestions may remain unless the configured merge blocking threshold includes them.

After Approval

When auto-approve fires, you can optionally chain additional actions from the same settings section.

gitar-approved Label

Enable Apply gitar-approved label to mark approved PRs. See gitar-approved for label behavior.

Auto-Merge

Enable Auto-merge PRs to merge automatically after approval. See Auto-Merge for platform prerequisites and merge methods.

Per-Repo Criteria

You can define criteria at the repository level by placing a Markdown file at .gitar/config/approve.md. Repo criteria work on their own or alongside org-level criteria. Gitar reads this file from the default branch. Changes take effect after they merge, so a PR cannot change its own approval policy. If Gitar cannot verify the file, it withholds approval for that run. See Repository Customization for more on the .gitar directory and how repo-level config files work.

Combination Logic

Organization criteria include shared approval policy from selected configuration repositories. If shared approval policy cannot be verified, Gitar withholds automatic approval for that run.

Platform Behavior

Auto-approve works on GitHub, GitLab, Azure DevOps, and both Bitbucket editions. See Platform Support for preview availability.
Gitar submits an approving review on the PR. It can count toward required approvals, subject to the repository’s rules. Required code-owner reviews, additional approvals, and status checks still apply.The review body reads: “Gitar has auto-approved this PR” with a link to your auto-approve settings.The approval message alone does not confirm that auto-merge was enabled. Check the dashboard comment for the auto-merge outcome.
Gitar approves the MR via the API. If your approval rules list Gitar as an eligible approver, this counts toward the required approval count.When auto-merge is enabled and its separate merge criteria are met, Gitar attempts to enable it. Approval can still succeed when auto-merge is held.
Gitar sets an Approved vote on the PR using the connected service account. When auto-merge is enabled and its separate merge criteria are met, Gitar attempts to enable auto-complete. Approval can still succeed when auto-complete is held.
Gitar approves the PR on Cloud and Data Center. Bitbucket Cloud has no auto-merge to arm. On Data Center, when auto-merge is enabled and its separate merge criteria are met, Gitar merges the PR itself once Bitbucket’s merge checks pass. Approval can still succeed when the merge is held.

Revocation

Each new review checks the current PR against the current criteria. On GitHub, resolving finding threads can trigger another approval evaluation without a push once the review is eligible. The dashboard shows Re-evaluating while that check runs. If Gitar integrates other commits while pushing a fix, it requires a fresh review before auto-approving the updated branch. If a later evaluation finds blocking findings or unmet approval criteria, Gitar revokes its previous approval. A clean review alone does not preserve approval when the criteria are no longer met:
  • On GitHub, Gitar dismisses its approving review.
  • On GitLab, Gitar calls the unapprove API.
  • On Azure DevOps, Gitar clears its approval vote.
  • On Bitbucket, Gitar removes its approval.
  • Gitar also attempts to cancel auto-merge it enabled.
If the gitar-approved label was applied, Gitar removes it when the approval is revoked.
If Gitar cannot complete approval evaluation, it skips approval for that run.