-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolicy-gate.yml.example
More file actions
106 lines (103 loc) · 2.65 KB
/
policy-gate.yml.example
File metadata and controls
106 lines (103 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# github-policy-gate example configuration
# Copy this file to .github/policy-gate.yml and adapt the policies you need.
policies:
- id: queue-change-requires-tests
description: Queue or store changes must include tests or failure-mode docs.
severity: error
when:
changed:
- "runtime/queue/**"
- "runtime/store/**"
require:
any:
- changed:
- "tests/**"
- changed:
- "failure_modes/**"
message: "Queue/store changes require tests or failure-mode updates."
- id: public-api-change-needs-changelog
description: Public API changes require a changelog update or exemption label.
severity: warn
when:
changed:
- "api/public/**"
require:
any:
- changed:
- "CHANGELOG.md"
- has_label:
- "release-note-exempt"
message: "Public API changes should include a changelog update or exemption label."
# Feature examples
#
# `exists(globs)`
# - id: readme-must-exist
# severity: warn
# require:
# exists:
# - "README.md"
# message: "This repository should keep a README."
#
# `pr_text(patterns)`
# - id: deploy-change-needs-rollback-text
# severity: warn
# when:
# changed:
# - ".github/workflows/**"
# require:
# pr_text:
# - "rollback"
# - "runbook"
# message: "Workflow changes should mention rollback or runbook context in the PR body."
#
# `title(patterns)`
# - id: release-title-format
# severity: warn
# when:
# changed:
# - "api/public/**"
# require:
# title:
# - "^release:"
# message: "Public API changes should use a release-oriented PR title."
#
# `approval_count_at_least(n)`
# - id: auth-needs-approvals
# severity: error
# when:
# changed:
# - "auth/**"
# - "infra/**"
# require:
# approval_count_at_least: 2
# message: "Auth or infra changes require at least two approvals."
#
# `file_contains(globs, patterns)`
# - id: runbook-must-mention-rollback
# severity: warn
# when:
# changed:
# - ".github/workflows/**"
# require:
# file_contains:
# globs:
# - "docs/runbooks/**/*.md"
# patterns:
# - "rollback"
# - "abort"
# message: "Workflow changes should be backed by a runbook that mentions rollback."
#
# `all` and `not`
# - id: deploy-label-required-unless-exempt
# severity: warn
# when:
# all:
# - changed:
# - ".github/workflows/**"
# - not:
# has_label:
# - "policy-exempt"
# require:
# has_label:
# - "deploy-change"
# message: "Workflow changes should carry a deploy-change label unless policy-exempt."