Skip to content

Commit 4dd6f3c

Browse files
mschmickingclaude
andcommitted
docs: correct the branch-protection step for the free plan
Branch protection and rulesets are unavailable for private repositories on the free plan — both API endpoints answer 'Upgrade to GitHub Pro or make this repository public'. The checklist put them in the 'do these first, while still private' section, which cannot be done. They move to the after-going-public section, where they start working. Also spells out why squash is the only merge mode to leave enabled: the conventional-commit check validates the PR title, and nothing validates the commits inside a branch, so rebase merging would replay unvalidated messages onto main where release-please reads them. Adds the ruleset name and the two traps: a status check cannot be selected until it has run once, and release-please needs bypass if 'require a pull request' is enforced, since it pushes its release branch directly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent c4d9136 commit 4dd6f3c

1 file changed

Lines changed: 44 additions & 15 deletions

File tree

docs/GOING-PUBLIC.md

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,29 @@ Work top to bottom. The ordering in step 4 matters.
1212

1313
These change how merges behave, and the release automation depends on them.
1414

15+
> **Branch protection is not in this section on purpose.** On the free plan it is
16+
> unavailable for private repositories — the API answers "Upgrade to GitHub Pro or make
17+
> this repository public to enable this feature". It has to wait until step 5.
18+
1519
- [ ] **Settings → General → Pull Requests**
1620
- [ ] Enable **Allow squash merging**
17-
- [ ] Disable **Allow merge commits** and **Allow rebase merging**
21+
- [ ] Disable **Allow merge commits**
22+
- [ ] Disable **Allow rebase merging**
1823
- [ ] Set **Default commit message** for squash merges to **Pull request title**
1924

20-
> **Why this is not optional:** the squashed commit message is what release-please
21-
> parses to decide the next version. A default GitHub merge message does not parse as a
22-
> conventional commit, so releases silently never happen.
25+
> **Why squash only:** the commit that lands on `main` is what release-please reads to
26+
> decide the next version, and the `conventional-commit` check validates the **PR
27+
> title** — nothing validates the individual commits inside a branch.
28+
>
29+
> - _Squash_ → the validated PR title becomes the commit. Always parses. One PR, one
30+
> changelog entry.
31+
> - _Rebase_ → replays every commit from the branch onto `main` with its own message.
32+
> "wip", "fix typo" and "oops" land unvalidated, and each is a candidate changelog
33+
> entry. Nothing checks them.
34+
> - _Merge_ → adds "Merge pull request #N from …", which does not parse at all.
35+
>
36+
> So **yes, turn rebase merging off** unless you are willing to hand-write conventional
37+
> commits for every intermediate commit in every branch.
2338
2439
- [ ] **Settings → General → Pull Requests** → enable **Automatically delete head
2540
branches**
@@ -32,17 +47,6 @@ These change how merges behave, and the release automation depends on them.
3247
> final step with "GitHub Actions is not permitted to create or approve pull requests".
3348
> A stale `release-please--branches--main--...` branch is the symptom.
3449
35-
- [ ] **Settings → Rules → Rulesets** (or Branches → branch protection) for `main`:
36-
- [ ] Require a pull request before merging
37-
- [ ] Require status checks to pass, and select:
38-
`test (22)`, `test (24)`, `audit`, `conventional-commit`, `gitleaks`
39-
- [ ] Require branches to be up to date before merging
40-
- [ ] Block force pushes
41-
42-
> Without this, CI still reports failures but nothing stops a merge. Note that
43-
> selecting a check only works after it has run at least once, so push a throwaway PR
44-
> first if the names do not appear.
45-
4650
## 2. Secrets and tokens
4751

4852
- [ ] Create an npm account if you do not have one, and enable 2FA on it
@@ -116,6 +120,31 @@ Things that only start working once the repository is public:
116120
- [ ] Run whatever external analysis you planned (SonarQube Cloud). Worth pointing it at
117121
`src/sync/safe-path.ts` (server-controlled ids become file paths) and
118122
`src/credentials.ts` specifically.
123+
- [ ] **Branch protection** — now available, since the repository is public.
124+
**Settings → Rules → Rulesets → New branch ruleset**:
125+
126+
- Name: `main` (the name is only a label; it appears in the "blocked by" message when
127+
a push is rejected, so something plain is better than something clever)
128+
- Enforcement status: **Active**
129+
- Target branches: **Include default branch**
130+
- Rules:
131+
- [ ] Require a pull request before merging (approvals: 0 is fine for a solo project —
132+
it still forces the PR flow so the checks run)
133+
- [ ] Require status checks to pass → add `test (22)`, `test (24)`, `audit`,
134+
`conventional-commit`, `gitleaks`
135+
- [ ] Require branches to be up to date before merging
136+
- [ ] Block force pushes
137+
138+
> A status check can only be selected after it has run at least once, so open a
139+
> throwaway PR first if the names do not appear in the picker.
140+
>
141+
> Leave **Restrict deletions** on and **Require signed commits** off unless you already
142+
> sign commits — turning it on retroactively blocks your own merges.
143+
>
144+
> Note release-please pushes its release branch directly. If you enable "Require a pull
145+
> request" with bypass disabled, add the GitHub Actions app to the bypass list, or the
146+
> release PR cannot be created.
147+
119148
- [ ] Add repository topics: `iobroker`, `cli`, `home-automation`, `typescript`
120149
- [ ] Set the repository description and homepage
121150

0 commit comments

Comments
 (0)