User manual
This manual explains what gh-maintainer does on each run, how it decides, and how you work with it in the widget. For setup, see Installation.
How a run works
Section titled “How a run works”The agent runs as a Kubernetes CronJob every two hours (0 */2 * * *). Each run:
- Emits
run.startedwith the currentdryRunflag. - Lists the repositories of the configured
owner, drops archived repositories and forks, and appliesrepos.includeandrepos.exclude. - Rotates the list so a different repository goes first each run. The repositories at the end of the list are not always the ones cut off by time budgets or rate limits.
- For each repository, runs the Dependabot, Branches and Security modules in that order, between
repo.startedandrepo.done(orrepo.error). - Emits
run.finishedwith totals:merged,approvals,fixes,branchesDeleted,errorsandrateLimited.
An error in one repository emits repo.error and the run continues with the next one. A run can take at most 90 minutes (activeDeadlineSeconds: 5400); a run that never finishes is marked aborted when the next one starts.
Dependabot module: auto-merge Dependabot pull requests
Section titled “Dependabot module: auto-merge Dependabot pull requests”The module handles every open pull request opened by dependabot[bot]. Pull requests by anyone else are ignored. For each one, the agent decides in this order; the first rule that applies wins:
| # | Condition | Action | Event |
|---|---|---|---|
| 1 | The PR has a commit that is not Dependabot’s | Ask for approval | approval.requested, reason ai-fix |
| 2 | The PR has merge conflicts | Comment @dependabot rebase |
pr.rebase_requested |
| 3 | Checks are still running, or GitHub has not computed mergeability yet | Wait | pr.pending, reason checks |
| 4 | Checks failed | Run the fixer | see The fixer |
| 5 | Major bump, unparseable bump, or a type not in autoMergeTypes |
Ask for approval | approval.requested, reason major |
| 6 | Green patch or minor bump, mergeable, mergeable_state clean or has_hooks |
Squash-merge, pinned to the checked head SHA | pr.merged |
| 7 | Green patch or minor bump that GitHub does not allow to merge yet | Wait | pr.pending, reason blocked |
Classifying a bump
Section titled “Classifying a bump”The agent reads the version bump from the PR title (Bump lodash from 4.17.20 to 4.17.21) and compares the versions with plain semver:
- Different major version: major.
- Same major, different minor: minor.
- Same major and minor: patch.
- Anything it cannot parse, such as a grouped update (
Bump the npm group with 5 updates), a pre-release or a commit SHA: treated as major.
The PR body is deliberately not parsed, so a grouped update can never be auto-merged.
Pinned merges
Section titled “Pinned merges”A merge passes the head SHA whose checks the agent just read. If a commit lands in between, GitHub refuses the merge with 409, and the PR gets pr.pending with reason head moved. The next run looks at it again.
Foreign commits
Section titled “Foreign commits”A PR counts as untouched only when every commit’s author is dependabot[bot] and its committer is dependabot[bot] or GitHub itself (as on signed Dependabot commits). Anything else is a foreign commit: the fixer’s own commit, a human edit, or an “Update branch” merge. Such a PR is never auto-merged, even after its CI turns green, and conflicts on it are not sent back to Dependabot. It goes to the approval queue with reason ai-fix. If Dependabot rebases the PR and drops the extra commits, it is treated as a plain Dependabot PR again.
Pending reasons
Section titled “Pending reasons”A pr.pending event always carries a reason:
| Reason | Meaning |
|---|---|
checks |
CI is still running, or GitHub has not computed mergeability yet |
blocked |
A green patch/minor bump, but GitHub’s mergeable_state is not clean/has_hooks: branch protection, required reviews, behind base, or draft |
head moved |
A push landed between the check and the pinned merge |
fixer disabled |
Checks failed, but the fixer is off or the repository is not in fixer.repos |
cooldown |
Checks failed, but the fixer already tried this PR within fixer.cooldownHours |
time budget |
Checks failed, but the run is older than 45 minutes, so no new fix starts |
error |
Handling this one PR failed; data.message has the scrubbed reason. The rest of the repository still runs. |
The fixer
Section titled “The fixer”When a Dependabot PR has failing checks, the fixer tries to repair it with headless Claude Code. It runs only when all of these are true:
fixer.enabledistrue.fixer.reposis not set, or contains the repository name.- The run is younger than 45 minutes.
- No fix attempt for this PR is recorded within the last
fixer.cooldownHours(default 24). Every attempt counts, including dry-run attempts and failures.
The fixer then:
- Collects the last 300 lines of each failed CI job (at most 60 KB in the prompt).
- Clones the PR branch and moves
.gitout of the working tree, so Claude never sees repository metadata. - Runs
claude -pwith--max-turnsset tofixer.maxTurnsand a timeout offixer.timeoutMinutes. The prompt marks the PR title and CI logs as untrusted data and asks for the minimal change that makes CI pass, without disabling tests or weakening checks. - Refuses the result if it touches anything under
.github/, if a.gitdirectory appeared, if git metadata was tampered with, or if the diff contains any of the agent’s tokens. - Commits as
gh-maintainer[bot]and pushes to the Dependabot branch.
Outcomes:
| Outcome | Event | Next step |
|---|---|---|
| A fix was pushed | pr.fix_pushed with the new sha, then approval.requested with reason ai-fix |
You review and approve or reject it |
| Dry run | action.would_push_fix with Claude’s summary |
Nothing is pushed |
| No fix, timeout, refusal or error | pr.fix_failed with status and summary |
The PR waits for the cooldown, then the fixer tries again |
A fix that would need a workflow change always ends as pr.fix_failed, with a summary saying a human must do it.
Branches module: delete stale branches
Section titled “Branches module: delete stale branches”The module deletes branches that are no longer needed. For each branch it decides in this order:
- Keep the default branch and every protected branch.
- Keep
main,master,developandrelease/*, always, plus every name inbranches.keep. A pattern that ends in*matches by prefix (release/*matchesrelease/1.2); anything else must match exactly. - Keep a branch with an open pull request.
- Delete a branch whose pull request was merged (reason
merged). - Delete a branch whose last commit is older than
branches.staleDaysdays, default 90 (reasonstale). A branch with only a closed, unmerged PR counts as having no PR. - Otherwise, keep it.
The module skips empty repositories and repositories without a known default branch, and it skips any branch whose commit date it cannot read.
Each deletion emits branch.deleted with the branch name, its last sha and the reason. Use the SHA to restore a deleted branch. If GitHub already deleted the branch (for example with “Automatically delete head branches”), the agent treats the deletion as done.
Security module
Section titled “Security module”The security module collects findings from several sources and emits one repo.findings event per repository. The status server compares it with the open findings it knows and derives finding.new and finding.resolved events.
| Source | What it checks | Severity |
|---|---|---|
dependabot-alert |
Open Dependabot alerts | From the advisory: critical, high, medium (moderate), else low |
code-scanning |
Open code scanning alerts | From the rule’s security severity, else error = high, warning = medium, else low |
secret-scanning |
Open secret scanning alerts (the secret value is never copied) | high |
hygiene |
Repository settings and files | see below |
workflow |
Static audit of .github/workflows/*.yml |
see below |
trivy |
trivy fs vulnerability and misconfiguration scan |
From the scanner |
gitleaks |
Secrets in the working tree | high |
osv |
osv-scanner against the OSV database |
From the database, else medium |
Hygiene rules:
| Rule | Severity |
|---|---|
no-branch-protection: the default branch is not protected |
medium |
secret-scanning-disabled |
medium |
dependabot-alerts-disabled |
medium |
no-dependabot-config: no .github/dependabot.yml |
low |
no-security-md: no SECURITY.md, .github/SECURITY.md or docs/SECURITY.md |
low |
Workflow rules:
| Rule | Severity |
|---|---|
prt-head-checkout: a pull_request_target workflow checks out the PR head |
high |
permissions-broad: write-all permissions, or a job without any permissions block |
medium |
unpinned-action: an action or reusable workflow not pinned to a full commit SHA (Docker actions need a digest) |
low |
workflow-parse-error: the YAML could not be parsed |
low |
Local scanners
Section titled “Local scanners”trivy, gitleaks and osv-scanner run on a fresh shallow clone of the default branch, at most once every security.localScanIntervalHours (default 24) per repository, and only within the first 60 minutes of a run. Each scanner has a 10-minute timeout.
A scanner that fails reports one low scanner-error finding for its source. Its source is then left out of that run, so its earlier findings stay open instead of being marked resolved. The same rule applies to GitHub alert types that are disabled: they never resolve findings.
Findings with severity critical or high turn the desktop tray icon red and fire a notification.
The widget
Section titled “The widget”The web widget is served by the status server at the root of your host. It loads a snapshot from /state, then follows the live event stream at /stream, so it updates within a second or two while a run is in progress.

The widget follows your system’s light or dark theme:

Header
Section titled “Header”The header shows the agent state (idle, running · N repos done, or an error after an aborted or failed run), when the last run started, a DRY-RUN badge in dry-run mode, and the connection state: live, connecting or offline · reconnecting.

Approvals
Section titled “Approvals”Every open approval shows a reason chip, the PR title, a link to the PR, and Approve and Reject buttons:
major: a major or unparseable version bump, or a bump type not inautoMergeTypes.ai-fix: a PR with a commit that is not Dependabot’s, usually a fix the fixer pushed.
Each repository is a block in a small isometric “city”, coloured and raised by the status of its last run: low green blocks are healthy, taller amber ones pending, the tallest red ones failing. Point at a block (or focus it with the keyboard) to see its name and status below the city; the city tilts slightly with the mouse.
| Status | Meaning |
|---|---|
ok |
Nothing pending |
pending |
Something waits: an approval, a pending PR, or the repository was interrupted by a rate limit |
failing |
A fix attempt failed |
error |
The repository failed with repo.error; hover for the message |
The heading counts failing and pending repositories.
Security
Section titled “Security”The total number of open findings and a key per severity (critical, high, medium, low). Press a key to list those findings, with links to the alert where one exists; a critical key glows while it has findings.
Activity
Section titled “Activity”Recent activity grouped by run, newest run first. Each run is a card with its start time, duration and totals (merged, fixes, approvals, pruned branches, errors); a running run pulses and shows live. Only the newest run is open; select an older run to expand it.
Inside a run, every repository that did something sits on a branch line with its result (ok, pending, error, running) and how long ago it was last active. Its events hang below it with an icon each: merges, deleted branches, pushed fixes, rebase requests, approvals, findings and errors. Messages wrap instead of being cut off, and approval PR numbers link to GitHub. Repositories that only scanned and had nothing to do are summed up in one line.
The filter chips (All, Changes, Approvals, Findings, Errors, each with a count) narrow the list to one kind of event. The layout adapts to the panel’s own width, so it also reads well in the narrow desktop window.
Agent config
Section titled “Agent config”The Agent config tab shows the configuration the agent runs with, read-only: owner, live or dry-run mode, which repositories are included or excluded, which Dependabot update types are merged automatically, the stale-branch rules, the fixer limits and the local scan interval. The status server reads it from the same gh-maintainer-config ConfigMap as the agent (via GET /info), so it always matches what the next run uses. To change it, edit your overlay; see the configuration reference.

The About tab shows the server’s version and commit, the owner, the server’s uptime and links to the documentation and the GitHub repository.
Approvals
Section titled “Approvals”Approve
Section titled “Approve”Approve asks the status server to merge the PR. The server re-checks the PR on GitHub first:
| Check | If it fails |
|---|---|
| The PR is still open and not merged | 409 pr already merged or pr closed, and the approval is closed |
| All checks are green | 409 checks not green, the approval stays open |
| GitHub reports it mergeable | 409 not mergeable, the approval stays open |
mergeable_state is clean or has_hooks |
409 blocked by branch protection, the approval stays open |
Then it squash-merges the PR, pinned to the head SHA it just checked, and emits pr.merged. If the PR changed in between, the answer is 409 pr changed, re-check. Clicking twice, or approving an approval that is no longer open, gives 409 approval in progress or approval not open.
A blocked by branch protection answer means GitHub would refuse the merge: give the required review or update the branch on GitHub, then approve again.
Reject
Section titled “Reject”Reject opens a small form with an optional reason (up to 500 characters). Confirm with Reject. The server posts a comment on the PR, gh-maintainer: approval closed without merging. Reason: <reason>, and marks the approval rejected. The PR itself stays open on GitHub.
How a reject sticks
Section titled “How a reject sticks”The agent re-requests open approvals on every run. A request for a rejected PR with the same title and reason is stored with data.ignored: true and hidden, and it does not notify. The approval comes back when the request changes: a new Dependabot version (a new title) or a new reason (for example major becomes ai-fix). To undo a reject, merge or close the PR on GitHub.
Stale approvals close themselves
Section titled “Stale approvals close themselves”If you merge or close a PR directly on GitHub, its approval would stay open in the widget. The status server cleans this up:
- after every agent run, when it receives
run.finished, and - when the status server starts.
It checks every open approval on GitHub and emits approval.closed with reason pr already merged or pr closed for each PR that is gone. Clicking Approve on such an approval has the same effect.
Dry-run mode
Section titled “Dry-run mode”With dryRun: true, the shipped default, every write to GitHub is replaced by an action.would_* event and nothing changes on GitHub:
| Event | Meaning |
|---|---|
action.would_merge {pr, method, sha} |
A green patch/minor Dependabot PR would be squash-merged |
action.would_delete_branch {branch} |
A merged or stale branch would be deleted |
action.would_comment {pr, body} |
A comment would be posted, such as @dependabot rebase |
action.would_push_fix {pr, summary} |
Claude produced a fix for a failing Dependabot PR; it is never pushed in dry run |
Some things are real in dry run, too:
- Findings and approval requests (
approval.requested,pr.fix_failed) are recorded and shown. - Claude really runs on failing PRs, and those runs use your subscription. The cooldown applies to dry-run attempts as well.
- Approve in the widget really merges.
The widget shows a DRY-RUN badge while the latest run was a dry run.
Run in dry run for about a week. Each day, check the feed:
- Would any
would_delete_branchhit a branch you want to keep? Add it tobranches.keep. - Are the
would_mergetargets really safe patch and minor bumps? - Are the fix summaries sensible?
Then switch to live mode.
Rate limits and time budgets
Section titled “Rate limits and time budgets”- Before each repository, the agent checks the token’s remaining REST quota. Below 100 requests, or on a rate-limit error anywhere, it emits
run.rate_limited(withremaining, which may benull), marks the interrupted repositorypending, finishes the run and continues on the next schedule. - No new fix starts after 45 minutes of run time.
- No new local scan starts after 60 minutes of run time.
An occasional run.rate_limited on a first run across many repositories is normal.