diff --git a/doc/source/_rulesets/branch_naming.json b/doc/source/_rulesets/branch_naming.json new file mode 100644 index 00000000..def4a2a4 --- /dev/null +++ b/doc/source/_rulesets/branch_naming.json @@ -0,0 +1,37 @@ +{ + "id": 2680634, + "name": "Branch naming", + "target": "branch", + "source_type": "Repository", + "enforcement": "active", + "conditions": { + "ref_name": { + "exclude": [ + "refs/heads/pre-commit-ci-update-config", + "refs/heads/main", + "refs/heads/gh-pages" + ], + "include": [ + "~ALL" + ] + } + }, + "rules": [ + { + "type": "deletion" + }, + { + "type": "non_fast_forward" + }, + { + "type": "branch_name_pattern", + "parameters": { + "operator": "regex", + "pattern": "^(feat|fix|chore|docs|style|refactor|test|testing|perf|ci|no-ci|build|dependabot|release|maint|junk|)\\/.*", + "negate": false, + "name": "" + } + } + ], + "bypass_actors": [] +} \ No newline at end of file diff --git a/doc/source/_rulesets/main.json b/doc/source/_rulesets/main.json index c2031bd9..f9f0cdd4 100644 --- a/doc/source/_rulesets/main.json +++ b/doc/source/_rulesets/main.json @@ -19,15 +19,6 @@ { "type": "non_fast_forward" }, - { - "type": "branch_name_pattern", - "parameters": { - "operator": "regex", - "pattern": "/release\\/*|feat\\/*|maint\\/*|fix\\/*|junk\\/*|no-ci\\/*|dependabot\\/*|test\\/*|testing\\/*/gm", - "negate": false, - "name": "Branch name must match the regex" - } - }, { "type": "pull_request", "parameters": { diff --git a/doc/source/how-to/contributing.rst b/doc/source/how-to/contributing.rst index e73fb9c8..8079a174 100644 --- a/doc/source/how-to/contributing.rst +++ b/doc/source/how-to/contributing.rst @@ -173,7 +173,7 @@ Create a branch --------------- It is likely that the repository's default branch name is ``main`` or ``master``. This is the -development branch for PyAnsys projects. For more information, see :ref:`Branching model`. +development branch for PyAnsys projects. For more information, see :ref:`Branching model`. You must implement new contributions in a different branch and then :ref:`Create a pull request` so that these changes can later be merged into the repository's ``main`` branch. @@ -205,6 +205,12 @@ changes any given branch is introducing before looking at the code. routines. - ``testing/`` or ``test/``: Improvements or changes to testing. - ``release/``: Releases (see below). +- ``chore/``: Other changes that don't modify the code. +- ``style/``: Changes that only affect code style. +- ``refactor/``: A code change that neither fixes a bug nor adds a feature. +- ``perf/``: A code change that improves performance. +- ``ci/``: Changes to the CICD configuration files and scripts. +- ``build/``: Changes that affect the build system or external dependencies. Push your branch ---------------- diff --git a/doc/source/how-to/repository-protection.rst b/doc/source/how-to/repository-protection.rst index 92cd5950..88d5a45f 100644 --- a/doc/source/how-to/repository-protection.rst +++ b/doc/source/how-to/repository-protection.rst @@ -40,6 +40,7 @@ template files for the branch protection and tag protection rulesets. Ruleset files: :download:`Main branch protection ruleset <../_rulesets/main.json>` +:download:`Branch naming protection ruleset <../_rulesets/branch_naming.json>` :download:`Tag create <../_rulesets/tag-create.json>` :download:`Tag delete <../_rulesets/tag-delete.json>`