There is a Github setting in the branch Ruleset that allows to:
Restrict commit metadata
Restrict commit author email addresses, committer email addresses, commit message content, and other metadata
This in turn allows us to set a regex that all PR titles (or commmits) to a default branch must follow. We can use this to enforce our PR titles to follow Conventional Commits.
What we need to do (in canonical-repo-automation):
- Switch away from classic branch protection rules to Rulesets;
- Force "Squash" of PR commits when merging
- Add the regex to filter conventional commits
The regex doesn't need to fully capture the Conventional Commits spec, but it should nudge us towards the correct PR titles. Importantly, we need to be able to capture a few different commit types, plus the optional ! for breaking changes.
This is needed mostly for clean auto-generated release notes, and to easily spot breaking changes.
There is a Github setting in the branch Ruleset that allows to:
This in turn allows us to set a regex that all PR titles (or commmits) to a default branch must follow. We can use this to enforce our PR titles to follow Conventional Commits.
What we need to do (in canonical-repo-automation):
The regex doesn't need to fully capture the Conventional Commits spec, but it should nudge us towards the correct PR titles. Importantly, we need to be able to capture a few different commit types, plus the optional
!for breaking changes.This is needed mostly for clean auto-generated release notes, and to easily spot breaking changes.