Skip to main content
The merge gate is Earnie’s decision on whether a pull request (GitHub) or merge request (GitLab) can merge. When someone opens or updates one, Earnie scans the change, checks its findings against the project’s policies, and reports the result on it. This page says “pull request” throughout. Everything on it also applies to a GitLab merge request, unless a note says otherwise. Before you start:
  • Connect the project’s repository through the Earnie GitHub App or a GitLab token. See Connecting a repository.
  • Attach at least one policy to the project. Without a policy, the gate has nothing to check, and the check reads No policies apply.

What Earnie Posts on a Pull Request

Each completed pull-request scan produces up to three things: On GitHub, a push to the repository’s default branch also gets the Earnie check, on the pushed commit. It has no comment, because there’s no pull request to comment on. GitLab doesn’t get a status for these pushes.

How the Check Is Decided

The findings the pull request introduced decide the check. Findings the default branch already had are listed in the summary comment, but they don’t hold the pull request. To tell which findings are new, Earnie compares the pull request with its latest completed scan of the default branch. The check shows one of these results: While the scan runs, the check reads Earnie is scanning this change. A neutral check is never a pass: Earnie hasn’t found anything wrong, and it hasn’t cleared anything either.

When the Check Can Block a Merge

Earnie’s check stops a merge only where the provider enforces it. Everywhere else the connection is advisory: Earnie still posts its check and comments, and for a block or a needed approval, the summary comment and the scan page say Earnie recommends blocking. This connection cannot enforce it.
On GitLab, a commit status doesn’t block a merge on its own. GitLab blocks on an outside result only through external status checks, which need GitLab Ultimate. On Ultimate, set Report the result as to Status check and turn on Status checks must succeed in the GitLab project. See Reporting to GitLab as a status check and Merge blocking depends on your GitLab plan.

Making the Check Block a Merge on GitHub

Publishing the Earnie check doesn’t stop a merge on its own: GitHub has to wait for it. Add Earnie as a required status check, in a branch ruleset or in branch protection, on the branch your pull requests merge into. Earnie reads that setting for each repository, using only the permissions the app already has:
  • Where the Earnie check is required, a blocking gate stops the merge.
  • Everywhere else, the gate is a recommendation.
  • If Earnie can’t read the setting, for example because GitHub hides a classic branch protection rule from the app, Earnie treats the gate as advisory.
A change to the setting takes effect within about five minutes. The GitHub card at Settings → Integrations describes the rule in its Merge blocking row: “Enforced where the Earnie check is required, advisory elsewhere”.

Inline Comments on the Changed Lines

Earnie places an inline comment for a finding only when all of these are true:
  • No approval covers it.
  • It’s new, and Earnie can attribute it to this pull request.
  • It meets the project’s inline comment floor, or a policy flagged it.
  • It overlaps a line the pull request added. A component finding from a manifest, which has no line of its own, goes on the first added block of that manifest.
  • Earnie has a suggested fix for it.
Findings on the same line, such as an AI SDK and a vector store read from one import, share one comment. The extra findings appear under Also on this line, and the comment counts once against the cap. Anything Earnie can’t place inline stays in the summary comment. That includes findings beyond the comment cap, and findings in files where the provider’s record of the changed lines is missing or incomplete: Earnie doesn’t guess where they belong. Each inline comment is headed with the finding’s title, then has the same sections in the same order: What, Why, Evidence, Remediation, Links, and a collapsible Prompt you can copy into a coding agent. The remediation uses the best evidence Earnie has, such as an explicit fixed version or a policy parameter. When Earnie doesn’t know an exact fix, it suggests the next step it can support with evidence. By default, inline comments start at Medium severity, with at most 10 per scan. A project can change both, though the cap can’t go above 10. A policy violation always gets its inline comment, whatever its severity.

When a Finding Is Resolved

  • If a later push removes the finding, Earnie replies with the commit that resolved it, and resolves the thread. A thread belongs to its line, not to one finding, so Earnie resolves it only once no finding remains on that line.
  • If a person resolves the thread while the finding still exists, Earnie treats that as an acknowledgement for this pull request, and doesn’t reopen it.
  • If a finding returns after Earnie resolved its thread, it can get a new comment.
This works the same way on GitHub review threads and GitLab discussions. An acknowledgement is not a Policy Approval: it doesn’t change the finding or the gate.

The Summary Comment

By default, Earnie posts the summary comment whatever the verdict, so a clean pull request also has a record of what Earnie checked. You can set a project to comment only when the gate fails, meaning it blocks, needs an approval, or failed to evaluate. A pull request or merge request that never failed then gets no summary comment. If it already has one, Earnie updates it when it passes, so a failing verdict doesn’t stay up after the fix. This works the same on GitHub and GitLab. Earnie doesn’t post a summary comment while the scan is running, for a cancelled scan, or when the check reads Base branch moved or No baseline.

When the Check Is Neutral

Earnie needs a comparison with the default branch to tell which findings a pull request introduced. When it can’t make that comparison, the check turns neutral instead of guessing. No baseline to compare against. Earnie has no completed scan of the default branch, so it can’t tell which findings are new. Scan the default branch, then push a commit or re-run the pull request’s scan. Base branch moved. Someone merged or pushed to the default branch, so the pull request’s result may no longer describe what merging would produce:
  1. Earnie scans the new head of the default branch.
  2. When that scan finishes, the check on every open pull request still based on the old head turns neutral, with the text Base branch moved; result is not conclusive.
  3. Push a commit or re-run the scan, and the check gives a real result again.
Earnie doesn’t re-scan any pull request for this. Only the check changes: the comments stay as they were. Earnie leaves merged and closed pull requests alone, because their checks record a decision that was already taken.
GitLab has no neutral status. On a merge request, a neutral check shows as success, with the same text as its description, so it blocks nothing. Push a commit or re-run the scan to get a real result back.

Choosing Which Pull Requests Earnie Checks

On a busy repository, not every pull request needs a check. An Operator or Admin can choose which pull requests Earnie scans, and how much it writes, in the project’s Scan Configuration, under Pull-request feedback. On a GitLab project the section is called Merge-request feedback. The Pull- and merge-request feedback section of a project's Scan Configuration, with the controls at their defaults The section has nine controls. Changes apply from the next pull-request scan: Patterns accept exact names, *, ?, [], and **, as in release/** or src/**. None of these controls changes a verdict. They decide which pull requests Earnie scans and how much it writes. Earnie judges every pull request it scans against the same policies, and no setting here can turn a block into a pass.

When a Scan Fails

Sometimes a scan ends without a verdict: the scan itself failed, or a policy couldn’t be evaluated because the evidence it reads is missing. The check then reads Evaluation failed. When a scan fails decides what that check does:
  • Block, the default, publishes Evaluation failed as a failure. The pull request waits until a scan succeeds.
  • Advisory publishes it as neutral instead, titled Evaluation failed (advisory, not blocking), which blocks nothing. Its summary adds This does not block the merge. Open Earnie to retry the scan.
Choose Advisory when a problem on Earnie’s side, such as an outage or a rate limit, must not hold every pull request behind a required check. A policy that blocks or needs an approval still fails the check in both modes. Changing the setting, on the project or as a locked organization setting, also updates the Evaluation failed check already posted on open pull requests and merge requests, shortly after you save. Switching to Advisory unblocks a waiting request without a re-scan, and switching back to Block makes it wait again. A closed or merged request keeps the check it had, and so does one whose base branch has moved since its scan, whose check already reads Base branch moved; result is not conclusive.
On GitLab, an advisory check shows as success. GitLab has no neutral status, so Earnie closes its commit status as success, and the description reads Evaluation failed (advisory, not blocking). The merge request stays mergeable under Pipelines must succeed, even when Earnie’s status is the pipeline’s only job.

Reporting to GitLab as a Status Check

On GitLab Ultimate, Earnie can report a merge request’s result as an external status check, which GitLab shows in the merge request’s Status checks widget. Report the result as decides where the result goes:
  • Commit status, the default, is a status on the head commit’s pipeline.
  • Status check answers Earnie’s external status check instead.
  • Both posts the two.
The first time Earnie publishes with Status check or Both, it creates a status check named Earnie on the GitLab project. It deletes the check when you go back to Commit status or disconnect the repository. A push to the default branch is not affected. Earnie posts nothing while the scan runs, so GitLab shows the check as pending, and GitLab fails a pending check that hears nothing within two minutes. The status check carries no text: the details stay in the summary note and behind the link to Earnie.
A status check needs GitLab Ultimate. On a connection without Ultimate, Earnie posts the commit status whichever you choose, and the control says so. To make the status check block a merge, turn on Status checks must succeed in the GitLab project’s merge request settings.
The path control fails toward scanning. If Earnie can’t find out which files a pull request touched, or can see only part of the list, it scans the pull request instead of skipping it.
A skipped pull request has no check. Earnie doesn’t scan it, so it posts no check and no comment. If you’ve made the Earnie check a required status check, a pull request that Earnie skips never receives it and can’t merge. Keep that in mind when you skip drafts or bots, or narrow the base-branch and path lists.

Setting the Controls for the Whole Organisation

The same eight controls are available for every project at Settings → Scan defaults, under Pull-request feedback. Turn on Apply to every project, the first control in that section, to make every project use the organisation’s values. Admins and Operators can change these controls and the lock. While the lock is on:
  • Each project’s section is read-only, shows the organisation’s values, and says that your organisation has locked these controls.
  • Earnie keeps each project’s own saved choices. They take effect again when the lock is turned off.

Three Routes When a Policy Blocks a Merge

When a policy blocks a pull request, someone has to make a decision, and Earnie records it. The summary comment and inline comments show the finding, the rule that fired, and the evidence. You have three routes, and each one leaves a record of who decided and why:

Route 1: Fix It

Upgrade or replace the component, and push the change. The next scan re-evaluates the pull request, and the gate clears without further action.

Route 2: Correct the Finding

A finding can be wrong. For example, your own code matched a published copy of it, or Earnie identified the wrong package. In that case, triage it. For example, marking a finding as original removes it from the gate, because the policy doesn’t apply to it.

Route 3: Request an Approval

When the risk is real, understood, and accepted, request a Policy Approval. It’s a recorded decision that one finding may pass one policy despite it. Admins and Operators can request one.
  1. Open the finding from the summary comment, in Review, or in the violations table on the policy’s page.
  2. Select Request approval.
  3. Fill in the fields:
    • Justification category says why the finding doesn’t apply or is acceptable: Component not present, Vulnerable code not present, Vulnerable code not in execute path, Vulnerable code cannot be controlled by adversary, Inline mitigations exist, Fixed, Under investigation, Incorrect data, or Other.
    • Justification is your reasoning, in your own words.
    • Expiry is 30 days (the default), 90 days, Custom date, or No expiry (not recommended).
  4. Select Request approval to submit.
A finding can have only one open or active approval for a policy at a time. Request approval isn’t offered while one is pending or in force.

What Happens Next

  1. The request is pending. The finding shows Pending approval. A pending request doesn’t change the verdict.
  2. An Admin decides. Only an Admin can approve or reject a request. They select Review request, which opens a drawer with the finding, the policy, who asked and when, the justification and the expiry. They select Approve or Reject, and must give a reason.
  3. Only an approval clears the finding. The gate holds it until then.
By default, an Admin can decide a request they made themselves. To require someone else to decide, an organisation can turn on Require a different approver under Approval rule on the Approvals tab of the organisation’s Policies page. With it on, the person who asked can still open their request with Review request, but the drawer says why it offers no decision. API keys can request approvals, but never approve them.
Give a request an expiry. Nobody revisits an approval that never expires. The policy pages mark an approval as Expiring soon in its last seven days, so you can review it before it lapses.
Rejected and revoked requests stay in the finding’s history alongside approved ones. Earnie discards nothing, so the record shows every request, not only the one that was approved.

What an Approval Covers

An approval covers one finding against one policy, in one project. It carries forward to later scans and pull requests where the same finding meets the same policy, until it expires or is revoked. It doesn’t cover the same finding under another policy, or other findings of the same component. An approval requested for a finding that so far exists only in a pull request carries over to the project’s own finding once the change merges, with the same state and expiry.

How an Approval Updates the Pull Request

When an approval changes a gate, Earnie updates the Earnie check and the comments of every scan it affects, straight away. The decision shows up on the pull request without anyone pushing a commit. Earnie doesn’t re-scan or re-evaluate anything. The scan, its findings, and the policy revisions it was judged against stay the same. Only the approval is new, and the check now reflects it. The check turns green only if approvals cover every violation still holding the gate. If another violation has no approval, the check stays red. Revoking an approval updates the pull request the same way, in reverse.

Finding What’s Waiting on You

An Admin can find pending requests without opening each policy. The project’s Policies page has an Approvals tab next to All policies. Its count shows only the requests still awaiting a decision, across every policy attached to the project, so it reads zero once the queue is clear.
  • Decide a pending request with Review request on its row, which opens the same drawer.
  • Switch Status between Pending, Approved, Rejected, and Revoked. Each option shows how many requests it holds. Expired approvals are listed under Approved.
  • To withdraw an approval, find it under Approved and select Revoke. You can revoke only an approval that hasn’t expired.
The organisation’s Policies page, in the sidebar, has an Approvals tab for every project at once. The Approvals tab of the organisation's Policies page: the Approval rule, the status buttons, and the requests of every project
  • Its count is the pending requests of all the projects you can open.
  • The queue has the same status buttons as a project’s, Pending by default. Each row adds the Project and the policy the request is on.
  • Select a row, or Review request, to open the decision drawer. You can approve or reject only if you have approval permission on that request’s project. Without it, you see the request and no decision buttons.
  • A request already decided opens read-only, with who decided it and why. Revoke ends an approval still in force.
  • Require a different approver is under Approval rule, above the queue. Anyone can read it. Changing it needs organisation write permission.

What’s Next

The merge gate checks a change once it reaches a pull request. The Earnie CLI applies the same policies earlier, in CI pipelines, in a pre-commit hook on a developer’s machine, and through coding agents.