You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/config_docs.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,7 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
97
97
```json
98
98
"prefix_rules": {
99
99
"default_channel": "default",
100
+
"default_branch_filters": ["develop"],
100
101
"rules": [
101
102
{
102
103
"match": [
@@ -109,6 +110,7 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
109
110
"backend/a5",
110
111
"backend/a4"
111
112
],
113
+
"branch_filters": [],
112
114
"channel": "backend"
113
115
},
114
116
{
@@ -117,15 +119,26 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
117
119
]
118
120
},
119
121
```
122
+
| value | description | optional | default |
123
+
|-|-|-|-|
124
+
|`default_channel`| default channel to notify if no rules match | Yes | don't notify any channel |
125
+
|`default_branch_filters`| fallback branch filters (see below) if none are declared locally for a rule | Yes | don't apply branch filtering and show `distinct` commits only |
126
+
|`rules`| list of `prefix_rule` objects | No | - |
120
127
121
128
### Prefix Rule
122
129
123
130
A **prefix rule** specifies whether or not a Slack channel should be notified, based on the filenames present in the commits associated with the given payload. The semantics for the `match` and `ignore` fields are the same as those for label rules (see above).
124
131
132
+
Default behavior is to apply each rule regardless of what branch is pushed, and when a rule is matched, show its `distinct` commits only.
133
+
Branch filters limit rule application to selected branches, and shows _all_ commits on match.
134
+
The filters can be declared globally with `default_branch_filters` (see above), or locally per rule with `branch_filters`, where the latter takes precedence.
135
+
To ignore a globally declared filter for a single rule, declare one locally with an empty list, as shown in the example above.
136
+
125
137
| value | description | optional | default |
126
138
|-|-|-|-|
127
139
|`match`| if commit files have any prefix in this list, they should be routed to the channel | Yes | all prefixes matched if no list provided |
128
140
|`ignore`| if commit files have any prefix in this list, they shouldn't be routed to the channel (even if they have any `match` prefixes) | Yes | - |
141
+
|`branch_filters`| consider commits only if pushed ref branch is in this list | Yes | fall back on `default_branch_filters` behavior (see above) |
129
142
|`channel`| channel to notify if the rule is matched | No | - |
0 commit comments