Closed
Labels
featureNew feature or request
Description
Description
Introduce a standardized branching strategy and enforcement across repositories created from this template. This includes defining standard branch names, applying branch protection rules programmatically, requiring signed commits and PR reviews, and enforcing naming conventions via CI.
Parent: #37
Problem Statement
Without a defined branching strategy and enforcement:
- Branch names and workflows vary by developer or project, reducing traceability
- Critical branches (e.g.
main,develop) may lack protection, increasing risk of direct pushes or unreviewed changes - Unsigned commits and unreviewed PRs weaken audit trails and compliance with change control expectations (e.g. IEC 62304, ISO 13485)
- Inconsistent branch naming makes automation, reporting, and baselining harder
We need a reproducible, template-driven setup so every new repository gets the same branching rules and safeguards from day one.
Proposed Solution
- Standard branches:
main,develop, and convention-based topic branches:release/*,hotfix/*,feature/*,bugfix/*(and optionallydocs/*,test/*,refactor/*as already used in this repo). - Branch protection rules: Applied programmatically (e.g. via GitHub API, Terraform, or repo configuration) for
mainanddevelop: require PR reviews, block force-push/delete, optional status checks. - Signed commits: Require signed commits (e.g. GPG or S/MIME) for protected branches where feasible.
- PR reviews: Require at least one approval before merge on protected branches.
- Naming enforcement: Enforce branch naming conventions in CI (e.g. regex or existing rules such as
.cursor/rules/branch-naming.mdc) and optionally via branch protection or GitHub Actions.
Deliverables can include: documentation of the strategy, scripts or config to apply branch protection, and CI jobs that validate branch names on push or PR.
Alternatives Considered
- Relying only on documentation: insufficient without enforcement.
- Manual setup per repository: error-prone and inconsistent.
- Third-party tools only: adds dependency; prefer native GitHub features plus minimal CI where needed.
Additional Context
- Aligns with commit message standardization ([FEATURE] Standardize and Enforce Commit Message Format #36) and the broader repo setup automation ([FEATURE] Automate and Standardize Repository Setup for Devcontainer Template #37).
- Branch naming conventions are already partially defined in this repo (e.g. branch-naming rule); this issue extends to enforcement and protection.
- Related: release cycle ([FEATURE] Automate and Standardize Repository Setup for Devcontainer Template #37 point 3), default GitHub Actions ([FEATURE] Automate and Standardize Repository Setup for Devcontainer Template #37 point 4), security ([FEATURE] Automate and Standardize Repository Setup for Devcontainer Template #37 point 5).
Impact
- Beneficiaries: Developers (clear workflow), QA/RA (audit trail, change control), auditors (consistent branching and protection).
- Compatibility: Backward compatible; new rules apply to repos created or updated from the template.
- Risks: Low; mainly adoption of signed commits and branch protection in existing repos that adopt the template.
Activity
c-vigo commentedon Jan 30, 2026
Organization Rules
Using GitHub Enterprise, we set rules across all repositories for any organization within the Enterprise.
Currently:
docs: update CHANGELOG
docs: add comprehensive release cycle documentation
chore: release 0.3.0 (#270)