Skip to content

Commit 982c59d

Browse files
committed
Convert branch protections to rule sets
1 parent 768e789 commit 982c59d

File tree

1 file changed

+77
-52
lines changed

1 file changed

+77
-52
lines changed

.github/repository-settings.md

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,96 @@ 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+
- EasyCLA
41+
- `required-status-check`
42+
- `gradle-wrapper-validation`
43+
- Block force pushes: CHECKED
44+
- Require code scanning results: CHECKED
45+
- CodeQL
46+
- Security alerts: High or higher
47+
- Alerts: Errors
48+
49+
### `benchmarks` branch
50+
51+
- Targeted branches:
52+
- `benchmarks`
53+
- Branch rules
54+
- Restrict deletions: CHECKED
55+
- Require linear history: CHECKED
56+
- Block force pushes: CHECKED
57+
58+
### Old-style release branches
59+
60+
- Targeted branches:
61+
- `v0.*`
62+
- `v1.*`
63+
- Branch rules
64+
- Restrict creations: CHECKED
65+
- Restrict updates: CHECKED
66+
- Restrict deletions: CHECKED
67+
68+
### Restrict branch creation
69+
70+
- Targeted branches
71+
- Exclude:
72+
- `release/*`
73+
- `renovate/**/*`
74+
- `otelbot/**/*`
75+
- `revert-*/**/*` (these are created when using the GitHub UI to revert a PR)
76+
- Restrict creations: CHECKED
77+
78+
### Restrict updating tags
79+
80+
- Targeted tags
81+
- All tags
82+
- Restrict updates: CHECKED
83+
- Restrict deletions: CHECKED
3984

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
85+
## Branch protections
5986

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

62-
### `benchmarks`
89+
- Restrict who can push to matching branches: CHECKED
6390

64-
- Everything UNCHECKED
91+
## Code security and analysis
6592

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)
93+
- Secret scanning: Enabled
6994

7095
## Secrets and variables > Actions
7196

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)
97+
- `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password
98+
- `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password
99+
- `SONATYPE_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
100+
- `SONATYPE_USER` - owned by [@jack-berg](https://github.com/jack-berg)

0 commit comments

Comments
 (0)