Skip to content

Latest commit

 

History

History
94 lines (65 loc) · 1.1 KB

File metadata and controls

94 lines (65 loc) · 1.1 KB

Configuration Reference

File location

Default path: .github/policy-gate.yml

Shape

policies:
  - id: string
    description: string
    severity: error | warn
    when: predicate
    require: predicate
    message: string

when is optional. If omitted, the policy always applies.

Predicates

changed

changed:
  - 'src/**'

exists

exists:
  - 'README.md'

pr_text

pr_text:
  - 'rollback'

title

title:
  - '^release:'

has_label

has_label:
  - 'deploy-change'

approval_count_at_least

approval_count_at_least: 2

file_contains

file_contains:
  globs:
    - 'docs/runbooks/**/*.md'
  patterns:
    - 'rollback'

Combinators

all

Every child must pass.

any

At least one child must pass.

not

Inverts a child predicate.

Validation rules

  • Unknown top-level and policy keys are rejected.
  • Invalid severities are rejected.
  • Empty IDs, messages, and arrays are rejected.
  • Invalid predicate shapes are rejected.
  • Negative approval thresholds are rejected.