-
Notifications
You must be signed in to change notification settings - Fork 47
Description
In the Flatcar organization, many repositories still lack branch-protection rules, and Pull-Request workflows vary widely from repo to repo. Below is a unified configuration proposal that can be applied to most repositories (some may require special settings).
1. Default branch
- Set the default branch to main (or master).
Most modern tools default to main, so choosing main simplifies integrations.
2. Pull-Request settings
- Allow squash merging only
Disallow “Merge commits” and “Rebase merging.” Squash merging produces a single commit per PR on the default branch, yielding a clean, linear history. The commit message defaults to the PR title + description, and the squash commit links back to the PR for traceability. - “Suggest updating branch”
Encourages contributors to rebase their branch onto the latest default-branch changes. (You can later require branches to be up to date.) - Enable auto-merge once all requirements are met (approvals, CI).
- Automatically delete head branches after merge to keep the branch list tidy.
3. Branch ruleset for the default branch
Create a ruleset targeting your default branch.
4. Bypass permissions
Maintainer-level teams should be granted “bypass” privileges so they can override rules when necessary.
5. Target branches
Set the rule’s target to your default branch (e.g. main).
6. Individual rules
-
Restrict deletions — prevent accidental branch deletion (default ON).
-
Require linear history — forces contributors to rebase before merging.
-
Require review from Code Owners
- Ensures designated owners sign off on changes.
- Discussion: flatcar/Flatcar #1665
- Learn about CODEOWNERS: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
-
Require approval of the most recent reviewable push — guarantees the final approved commit is what gets merged.
-
Require conversation resolution before merging — ensures all review comments are addressed.
-
Allowed merge methods: Squash
-
Require status checks to pass — CI must succeed before merge.
-
Require branches to be up to date before merging — enforces rebasing onto the latest default branch.
-
Block force pushes — (optional; default ON; open for discussion).
-
Require code-scanning results — integrate your chosen code-scanning tool on every repo.
Note: These settings serve as guidelines—or “rails”—to keep our workflow consistent and maintain a clean history. Maintainers retain the ability to bypass or adjust any rule when exceptional circumstances arise.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status









