Skip to content

Commit 86aa8f7

Browse files
committed
docs: info about branch filter
1 parent ddf845b commit 86aa8f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

documentation/config_docs.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
9797
```json
9898
"prefix_rules": {
9999
"default_channel": "default",
100+
"default_branch_filters": ["develop"],
100101
"rules": [
101102
{
102103
"match": [
@@ -109,6 +110,7 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
109110
"backend/a5",
110111
"backend/a4"
111112
],
113+
"branch_filters": [],
112114
"channel": "backend"
113115
},
114116
{
@@ -117,15 +119,26 @@ A **label rule** specifies whether or not a Slack channel should be notified, ba
117119
]
118120
},
119121
```
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 | - |
120127

121128
### Prefix Rule
122129

123130
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).
124131

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+
125137
| value | description | optional | default |
126138
|-|-|-|-|
127139
| `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 |
128140
| `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) |
129142
| `channel` | channel to notify if the rule is matched | No | - |
130143

131144
## Status Options

0 commit comments

Comments
 (0)