diff --git a/.github/workflows/branch-name.yml b/.github/workflows/branch-name.yml index 25664f3f..01fe181e 100644 --- a/.github/workflows/branch-name.yml +++ b/.github/workflows/branch-name.yml @@ -1,5 +1,6 @@ name: branch-name -# Contributions reach master only through a pull request from feature/, being +# Contributions reach master only through a pull request from /, being a +# Conventional Commit type and # at least three lowercase words joined by single hyphens. master's ruleset requires this # check; the maintainer can bypass it. # Dependabot's own dependabot/... branches pass when Dependabot opened the pull request. @@ -11,16 +12,16 @@ jobs: branch-name: runs-on: ubuntu-latest steps: - - name: feature/ into master + - name: / into master env: { HEAD: "${{ github.head_ref }}", AUTHOR: "${{ github.event.pull_request.user.login }}" } run: | if [ "$AUTHOR" = "dependabot[bot]" ] && printf '%s' "$HEAD" | grep -Eq '^dependabot/'; then echo "ok: dependency update $HEAD" exit 0 fi - if printf '%s' "$HEAD" | grep -Eq '^feature/[a-z0-9]+(-[a-z0-9]+){2,}$'; then + if printf '%s' "$HEAD" | grep -Eq '^(feat|fix|perf|refactor|docs|test|build|ci|chore|style|revert)/[a-z0-9]+(-[a-z0-9]+){2,}$'; then echo "ok: $HEAD" else - echo "::error::branch '$HEAD' must be named feature/, being at least three lowercase words joined by single hyphens (letters and digits only), e.g. feature/fix-windows-install" + echo "::error::branch '$HEAD' must be named /, being one of feat, fix, perf, refactor, docs, test, build, ci, chore, style, revert and at least three lowercase words joined by single hyphens (letters and digits only), e.g. fix/windows-install-paths" exit 1 fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6464652c..1412e425 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,9 @@ contribution public under the AGPL. ## Branches and pull requests `master` takes changes only through a pull request, from the maintainer too. Name your branch -`feature/`, where the name is at least three lowercase words joined by hyphens (letters -and digits only, no underscores or dots), for example `feature/fix-windows-install`, and open +`/`: `` is the Conventional Commit type of the change (`feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`, `ci`, `chore`, `style` or `revert`), and the +name is at least three lowercase words joined by hyphens (letters and digits only, no +underscores or dots), for example `fix/windows-install-paths`. `feature/` is not a type. Open the pull request against `master`. A check fails any other branch name, and a pull request merges after the maintainer approves it.