Skip to content

Commit 3c6790f

Browse files
committed
Updated readme.
1 parent 00e9205 commit 3c6790f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,42 @@ overridevalidators:
123123
124124
A sample of `deployment-settings` file is found [here](docs/sample-settings/sample-deployment-settings.yml).
125125

126+
### Custom Status Checks
127+
For branch protection rules and rulesets, you can allow for status checks to be defined outside of safe-settings together with your usual safe settings.
128+
129+
This can be defined at the org, sub-org, and repo level.
130+
131+
To configure this for branch protection rules, specifiy `{{EXTERNALLY_DEFINED}}` under the `contexts` keyword:
132+
```yaml
133+
branches:
134+
- name: main
135+
protection:
136+
...
137+
required_status_checks:
138+
contexts:
139+
- "{{EXTERNALLY_DEFINED}}"
140+
```
141+
142+
For rulesets, specify `{{EXTERNALLY_DEFINED}}` under the `required_status_checks` keyword:
143+
```yaml
144+
rulesets:
145+
- name: Status Checks
146+
...
147+
rules:
148+
- type: required_status_checks
149+
parameters:
150+
required_status_checks:
151+
- context: "{{EXTERNALLY_DEFINED}}"
152+
```
153+
154+
Notes:
155+
- For branch protection rules, contexts defined at the org level are merged together with the sub-org and repo level contexts.
156+
- When `{{EXTERNALLY_DEFINED}}` is defined for a new branch protection rule or ruleset configuration, they will be deployed with no status checks.
157+
- When an existing branch protection rule or ruleset configuration is ammended with `{{EXTERNALLY_DEFINED}}`, the status checks in the existing rules in GitHub will remain as is.
158+
159+
⚠️ **Warning:**
160+
When `{{EXTERNALLY_DEFINED}}` is removed from an existing branch protection rule or ruleset configuration, the status checks in the existing rules in GitHub will revert to the checks that are defined in safe-settings.
161+
126162
### Performance
127163
When there are 1000s of repos to be managed -- and there is a global settings change -- safe-settings will have to work efficiently and only make the necessary API calls.
128164

0 commit comments

Comments
 (0)