Skip to content

Commit e479636

Browse files
authored
Convert branch protections to rule sets (#7095)
1 parent 3e1d953 commit e479636

File tree

1 file changed

+79
-52
lines changed

1 file changed

+79
-52
lines changed

.github/repository-settings.md

Lines changed: 79 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,98 @@ Repository settings in addition to what's documented already at
55

66
## General > Pull Requests
77

8-
* Allow squash merging > Default to pull request title
8+
- Allow squash merging > Default to pull request title
9+
10+
- Allow auto-merge
911

1012
## Actions > General
1113

12-
* Fork pull request workflows from outside collaborators:
14+
- Fork pull request workflows from outside collaborators:
1315
"Require approval for first-time contributors who are new to GitHub"
1416

1517
(To reduce friction for new contributors,
1618
as the default is "Require approval for first-time contributors")
1719

18-
## Branch protections
19-
20-
The order of branch protection rules
21-
[can be important](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule#about-branch-protection-rules).
22-
The branch protection rules below should be added before the `**/**` branch protection rule
23-
(this may require deleting the `**/**` rule and recreating it at the end).
24-
25-
### `main`
26-
27-
* Require branches to be up to date before merging: UNCHECKED
28-
29-
(PR jobs take too long, and leaving this unchecked has not been a significant problem)
30-
31-
* Status checks that are required:
32-
33-
* EasyCLA
34-
* required-status-check
35-
36-
### `release/*`
37-
38-
Same settings as above for `main`, except:
20+
- Workflow permissions
21+
- Default permissions granted to the `GITHUB_TOKEN` when running workflows in this repository:
22+
Read repository contents and packages permissions
23+
- Allow GitHub Actions to create and approve pull requests: UNCHECKED
24+
25+
## Rules > Rulesets
26+
27+
### `main` and release branches
28+
29+
- Targeted branches:
30+
- `main`
31+
- `release/*`
32+
- Branch rules
33+
- Restrict deletions: CHECKED
34+
- Require linear history: CHECKED
35+
- Require a pull request before merging: CHECKED
36+
- Required approvals: 1
37+
- Require review from Code Owners: CHECKED
38+
- Allowed merge methods: Squash
39+
- Require status checks to pass
40+
- Do not require status checks on creation: CHECKED
41+
- Status checks that are required
42+
- EasyCLA
43+
- `required-status-check`
44+
- `gradle-wrapper-validation`
45+
- Block force pushes: CHECKED
46+
- Require code scanning results: CHECKED
47+
- CodeQL
48+
- Security alerts: High or higher
49+
- Alerts: Errors
50+
51+
### `benchmarks` branch
52+
53+
- Targeted branches:
54+
- `benchmarks`
55+
- Branch rules
56+
- Restrict deletions: CHECKED
57+
- Require linear history: CHECKED
58+
- Block force pushes: CHECKED
59+
60+
### Old-style release branches
61+
62+
- Targeted branches:
63+
- `v0.*`
64+
- `v1.*`
65+
- Branch rules
66+
- Restrict creations: CHECKED
67+
- Restrict updates: CHECKED
68+
- Restrict deletions: CHECKED
69+
70+
### Restrict branch creation
71+
72+
- Targeted branches
73+
- Exclude:
74+
- `release/*`
75+
- `renovate/**/*`
76+
- `otelbot/**/*`
77+
- `revert-*/**/*` (these are created when using the GitHub UI to revert a PR)
78+
- Restrict creations: CHECKED
79+
80+
### Restrict updating tags
81+
82+
- Targeted tags
83+
- All tags
84+
- Restrict updates: CHECKED
85+
- Restrict deletions: CHECKED
3986

40-
* Restrict pushes that create matching branches: UNCHECKED
41-
42-
(So that opentelemetrybot can create release branches)
43-
44-
### `renovate/**/**`, and `opentelemetrybot/*`
45-
46-
* Require status checks to pass before merging: UNCHECKED
47-
48-
(So that renovate PRs can be rebased)
49-
50-
* Restrict who can push to matching branches: UNCHECKED
51-
52-
(So that bots can create PR branches in this repository)
53-
54-
* Allow force pushes > Everyone
55-
56-
(So that renovate PRs can be rebased)
57-
58-
* Allow deletions: CHECKED
87+
## Branch protections
5988

60-
(So that bot PR branches can be deleted)
89+
### `main`, `release/*`
6190

62-
### `benchmarks`
91+
- Restrict who can push to matching branches: CHECKED
6392

64-
- Everything UNCHECKED
93+
## Code security and analysis
6594

66-
(This branch is currently only used for directly pushing benchmarking results from the
67-
[overhead benchmark](https://github.com/open-telemetry/opentelemetry-java/actions/workflows/benchmark.yml)
68-
job)
95+
- Secret scanning: Enabled
6996

7097
## Secrets and variables > Actions
7198

72-
* `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password
73-
* `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password
74-
* `SONATYPE_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
75-
* `SONATYPE_USER` - owned by [@jack-berg](https://github.com/jack-berg)
99+
- `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password
100+
- `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password
101+
- `SONATYPE_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
102+
- `SONATYPE_USER` - owned by [@jack-berg](https://github.com/jack-berg)

0 commit comments

Comments
 (0)