Skip to content

Config file

Most options can be set on the CLI or in a config file. CLI flags always win on conflict.

Search paths

ghaar uses cosmiconfig and searches the current working directory and its ancestors for the first match of:

  • .ghaarrc
  • .ghaarrc.json
  • .ghaarrc.yaml
  • .ghaarrc.yml
  • ghaar.config.js
  • ghaar.config.mjs
  • ghaar.config.cjs
  • A "ghaar" key in package.json

Schema

All fields are optional. The defaults shown below are applied when a field is missing.

json
{
  "workflows": [],
  "reject": [],
  "branch": null,
  "minSeverity": "notice",
  "managementLabel": "automation/annotation-reporter",
  "maxIssues": 25,
  "wontfix": {
    "labels": ["wontfix"],
    "respectStateReason": true,
    "commentPattern": null
  },
  "autoClose": {
    "enabled": true,
    "afterDays": 7,
    "afterMisses": 3,
    "requireSuccess": true
  }
}

Field reference

FieldTypeNotes
workflowsstring[]Glob patterns matched against workflow names AND repo-relative paths. Empty = match all.
rejectstring[]Glob patterns excluded from the scan. Excludes win over includes.
branchstring | nullBranch whose latest run is scanned. null = repo's default branch.
minSeverity"notice" | "warning" | "error"Annotations below this drop out of the scan.
managementLabelstringLabel applied to every issue we own; used as the lookup key for prior issues.
maxIssuesinteger ≥ 1Cap on create/update/reopen writes per run. Auto-close is unthrottled.
wontfix.labelsstring[]Closed issues with any of these labels suppress future filings.
wontfix.respectStateReasonbooleanTreat state_reason: not_planned as suppression.
wontfix.commentPatternstring | nullRegex matched against the closing comment. null disables.
autoClose.enabledbooleanMaster switch for the vanish pass.
autoClose.afterDaysinteger ≥ 0Min days since last-seen before close. 0 closes on the first miss (not recommended).
autoClose.afterMissesinteger ≥ 1Min consecutive scans the annotation must be absent.
autoClose.requireSuccessbooleanRefuse to auto-close when the workflow's latest run did not succeed.

Example: tightening up

yaml
# .ghaarrc.yaml
workflows: ['ci.yml', 'release.yml']
minSeverity: warning
maxIssues: 50
wontfix:
  labels: [wontfix, accepted-noise]
  commentPattern: '(?i)wont ?fix|accepted'
autoClose:
  afterDays: 3
  afterMisses: 2

Precedence

For each option:

  1. CLI flag (highest priority).
  2. Config file value.
  3. Default (lowest priority).

Nested objects (wontfix, autoClose) deep-merge: config-file fields not overridden by a CLI flag are kept.

Released under the MIT License.