From afe50ad24835b565c3af04793a938df05abf975b Mon Sep 17 00:00:00 2001 From: Jamil Date: Wed, 16 Nov 2022 08:28:51 -0800 Subject: [PATCH] Conventional Commits (#1116) * chore: add conventional-commits * Use branch for conventional commits * Remove dupe workflow :hammer: --- .github/pr-labeler.yml | 11 +++++++++++ .github/workflows/pr_labeler.yml | 20 ++++++++++++++++++++ .pre-commit-config.yaml | 6 +++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/pr-labeler.yml create mode 100644 .github/workflows/pr_labeler.yml diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 000000000..e586a2345 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,11 @@ +feature: ['feat/*', 'feature/*'] +chore: ['chore/*'] +bug: ['fix/*', 'bug/*'] +build: ['build/*'] +ci: ['ci/*'] +docs: ['docs/*'] +style: ['style/*'] +refactor: ['refactor/*'] +perf: ['perf/*'] +test: ['test/*'] +revert: ['revert/*'] diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml new file mode 100644 index 000000000..c442d4d6c --- /dev/null +++ b/.github/workflows/pr_labeler.yml @@ -0,0 +1,20 @@ +name: PR Labeler +on: + pull_request: + types: [opened] + +permissions: + contents: read + +jobs: + pr-labeler: + permissions: + contents: read # for TimonVS/pr-labeler-action to read config file + pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR + runs-on: ubuntu-latest + steps: + - uses: TimonVS/pr-labeler-action@v4 + with: + configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b5c6f09e..32e520589 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,4 +53,8 @@ repos: exclude: "^omnibus/config/patches/" - id: check-merge-conflict - id: no-commit-to-branch - args: [-b, master, -b, develop] + args: + - -b + - master + - --pattern + - '^(?!((chore|feat|feature|bug|fix|build|ci|docs|style|refactor|perf|test|revert)\/[a-zA-Z0-9\-]+)$).*'