Skip to content

Commit c0aa897

Browse files
committed
Add a rust-specific ruleset for version branches
This is the same as the Python rule, but with different CI checks that are required, to match the Rust CI. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent d1452df commit c0aa897

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

docs/user-guide/start-a-new-project/configure-github.md

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ Import the following
106106
* [Protect version
107107
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/python/Protect version branches.json)
108108

109+
##### Rust specific rulesets
110+
111+
* [Protect version
112+
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/rust/Protect version branches.json)
113+
109114
### Code security and analysis
110115

111116
* Enable *Dependabot version updates* if relevant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"name": "Protect version branches",
3+
"target": "branch",
4+
"source_type": "Repository",
5+
"source": "frequenz-floss/frequenz-repo-config-python",
6+
"enforcement": "active",
7+
"conditions": {
8+
"ref_name": {
9+
"exclude": [],
10+
"include": [
11+
"~DEFAULT_BRANCH",
12+
"refs/heads/v[0-9]*.[0-9x]*.x"
13+
]
14+
}
15+
},
16+
"rules": [
17+
{
18+
"type": "non_fast_forward"
19+
},
20+
{
21+
"type": "required_signatures"
22+
},
23+
{
24+
"type": "pull_request",
25+
"parameters": {
26+
"require_code_owner_review": true,
27+
"require_last_push_approval": true,
28+
"dismiss_stale_reviews_on_push": true,
29+
"required_approving_review_count": 1,
30+
"required_review_thread_resolution": false
31+
}
32+
},
33+
{
34+
"type": "required_status_checks",
35+
"parameters": {
36+
"strict_required_status_checks_policy": false,
37+
"do_not_enforce_on_create": false,
38+
"required_status_checks": [
39+
{
40+
"context": "DCO"
41+
},
42+
{
43+
"context": "Check release notes are updated",
44+
"integration_id": 15368
45+
},
46+
{
47+
"context": "test",
48+
"integration_id": 15368
49+
}
50+
]
51+
}
52+
},
53+
{
54+
"type": "deletion"
55+
}
56+
],
57+
"bypass_actors": [
58+
{
59+
"actor_id": 2,
60+
"actor_type": "RepositoryRole",
61+
"bypass_mode": "pull_request"
62+
},
63+
{
64+
"actor_id": 5,
65+
"actor_type": "RepositoryRole",
66+
"bypass_mode": "always"
67+
},
68+
{
69+
"actor_id": 1,
70+
"actor_type": "OrganizationAdmin",
71+
"bypass_mode": "always"
72+
}
73+
]
74+
}

0 commit comments

Comments
 (0)