Skip to content

Commit 49e0be7

Browse files
committed
doc: rulesets for branch and tag naming
1 parent b83b0fa commit 49e0be7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/source/how-to/contributing.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,26 @@ changes any given branch is introducing before looking at the code.
206206
- ``testing/`` or ``test/``: Improvements or changes to testing.
207207
- ``release/``: Releases (see below).
208208

209+
Enforcing branch-name conventions
210+
---------------------------------
211+
212+
`GitHub rulesets
213+
<https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets>`_
214+
allow to enforce branch-name conventions. To do so, create a new ruleset named
215+
``conventional-commits``, then select the following configuration:
216+
217+
- Enforcement status: ``Active``
218+
- Target branches:
219+
- Include: ``All branches``
220+
- Exclude: ``main``, ``gh-pages``
221+
222+
- Restrict branch names:
223+
- Applies to: ``Branch name``
224+
- Requirement: ``Must match a given regex pattern``
225+
- Matching pattern: ``^(feat|fix|chore|docs|style|refactor|test|perf|ci|build|dependabot|release)\/.*``
226+
- Description: ``Branch name must match the conventional commits pattern``
227+
228+
209229
Push your branch
210230
----------------
211231

0 commit comments

Comments
 (0)