From 49e0be7e593e3c1ec10902de393ae11494b7b849 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 19 Sep 2024 10:41:23 +0200 Subject: [PATCH 1/2] doc: rulesets for branch and tag naming --- doc/source/how-to/contributing.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/source/how-to/contributing.rst b/doc/source/how-to/contributing.rst index e73fb9c83..40e600ea3 100644 --- a/doc/source/how-to/contributing.rst +++ b/doc/source/how-to/contributing.rst @@ -206,6 +206,26 @@ changes any given branch is introducing before looking at the code. - ``testing/`` or ``test/``: Improvements or changes to testing. - ``release/``: Releases (see below). +Enforcing branch-name conventions +--------------------------------- + +`GitHub rulesets +`_ +allow to enforce branch-name conventions. To do so, create a new ruleset named +``conventional-commits``, then select the following configuration: + +- Enforcement status: ``Active`` +- Target branches: + - Include: ``All branches`` + - Exclude: ``main``, ``gh-pages`` + +- Restrict branch names: + - Applies to: ``Branch name`` + - Requirement: ``Must match a given regex pattern`` + - Matching pattern: ``^(feat|fix|chore|docs|style|refactor|test|perf|ci|build|dependabot|release)\/.*`` + - Description: ``Branch name must match the conventional commits pattern`` + + Push your branch ---------------- From 5e61f02c2dae50f14dc9f4f1bfaa3ffbcda5ed83 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 19 Sep 2024 10:47:49 +0200 Subject: [PATCH 2/2] fix: move content to the right section --- doc/source/how-to/contributing.rst | 20 -------------------- doc/source/how-to/repository-protection.rst | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/doc/source/how-to/contributing.rst b/doc/source/how-to/contributing.rst index 40e600ea3..e73fb9c83 100644 --- a/doc/source/how-to/contributing.rst +++ b/doc/source/how-to/contributing.rst @@ -206,26 +206,6 @@ changes any given branch is introducing before looking at the code. - ``testing/`` or ``test/``: Improvements or changes to testing. - ``release/``: Releases (see below). -Enforcing branch-name conventions ---------------------------------- - -`GitHub rulesets -`_ -allow to enforce branch-name conventions. To do so, create a new ruleset named -``conventional-commits``, then select the following configuration: - -- Enforcement status: ``Active`` -- Target branches: - - Include: ``All branches`` - - Exclude: ``main``, ``gh-pages`` - -- Restrict branch names: - - Applies to: ``Branch name`` - - Requirement: ``Must match a given regex pattern`` - - Matching pattern: ``^(feat|fix|chore|docs|style|refactor|test|perf|ci|build|dependabot|release)\/.*`` - - Description: ``Branch name must match the conventional commits pattern`` - - Push your branch ---------------- diff --git a/doc/source/how-to/repository-protection.rst b/doc/source/how-to/repository-protection.rst index 72f9f0159..9de347084 100644 --- a/doc/source/how-to/repository-protection.rst +++ b/doc/source/how-to/repository-protection.rst @@ -70,6 +70,20 @@ The PyAnsys core team recommends setting these rules for the ``main`` branch: go through and resolve all comments. This ensures that all comments are read and possibly applied. +For other branches, conventional commits can be enforced by creating a rule +with the following parameters: + +- Enforcement status: ``Active`` +- Target branches: + - Include: ``All branches`` + - Exclude: ``main``, ``gh-pages`` + +- Restrict branch names: + - Applies to: ``Branch name`` + - Requirement: ``Must match a given regex pattern`` + - Matching pattern: ``^(feat|fix|chore|docs|style|refactor|test|perf|ci|build|dependabot|release)\/.*`` + - Description: ``Branch name must match the conventional commits pattern`` + Tag protection --------------