Skip to main content

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.

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 or MR as usual. If there are blocking findings (severity: Important or above), auto-approve is skipped.
2

Criteria are checked

Gitar evaluates your configured criteria against the PR metadata, changed files, and review results. If no criteria are configured, Gitar will approve the PR if there are no blocking issues found.
3

Approval is submitted

Gitar submits an approving review on GitHub or GitLab. The dashboard comment shows the approval and the rationale.

Enabling Auto-Approve

Auto-approve is configured in your organization settings:
  1. Navigate to Settings in the Gitar dashboard
  2. Open the Behavior section
  3. Enable the Auto-approve PRs/MRs 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. Conditions like “tests pass” or “linting is green” are not verified by Gitar and should instead be enforced via your platform’s branch protection or merge checks.

Default behavior (no criteria)

When the auto-approve toggle is enabled but no criteria are configured — neither in the dashboard nor in a repository’s .gitar/config/approve.md — Gitar will approve the PR if there are no blocking issues found.
If you previously had auto-approve enabled without criteria, your PRs were not being auto-approved. This default behavior was added in May 2026. Review your auto-approve settings if automatic approval is not desired.

After Approval

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

gitar-approved label

Enable the Apply gitar-approved label toggle to have Gitar add a gitar-approved label to approved PRs. The label is created automatically in your repository if it doesn’t exist. This makes approved changes easy to filter in your platform’s PR list.

Auto-merge

Enable the Auto-merge PRs/MRs after auto-approve toggle to arm your platform’s native auto-merge immediately after approval. On GitHub, you can also choose the merge method (squash, merge commit, or rebase). On GitLab, the project’s default merge method is used. See Auto-Merge for prerequisites and details.

Per-Repo Criteria

You can define criteria at the repository level by placing a Markdown file at .gitar/config/approve.md. This works independently or alongside org-level criteria:
  • Org criteria only — applies to all repositories in the organization.
  • Repo criteria only — applies to that repository even if no org criteria are set.
  • Both — Gitar combines them and the PR must satisfy all criteria.
See Repository Configuration for more on the .gitar directory and how repo-level config files work.
mkdir -p .gitar/config
echo "Only approve if no database migrations are included." > .gitar/config/approve.md

Combination Logic

Org criteriaRepo fileWhat happens
SetPresentBoth are combined — PR must satisfy all criteria
SetAbsentOrg criteria only
EmptyPresentRepo file criteria only
EmptyAbsentDefault — approve when all code review issues are addressed

Platform Behavior

Gitar submits an approving review on the PR. If your branch protection rules require an approving review, this satisfies that requirement.The review body reads: “Gitar has auto-approved this PR” with a link to your auto-approve settings.If auto-merge is also enabled, the review body mentions that auto-merge has been armed.
Gitar approves the MR via the API. If your approval rules list Gitar as an eligible approver, this counts toward the required approval count.If auto-merge is also enabled, Gitar calls the GitLab API to arm auto-merge after approval.

Revocation

If a new push introduces blocking findings, Gitar revokes its previous approval:
  • On GitHub, Gitar dismisses its approving review.
  • On GitLab, Gitar calls the unapprove API.
  • If auto-merge was armed, it is also disabled.
The gitar-approved label is not removed automatically — you can configure a rule to handle this if needed.
Auto-approve only ever submits approvals and never requests changes. If anything goes wrong during evaluation, the step is skipped and the PR is unaffected (fail-open).