From adf4d7e21265399d8362a66c973e05963617376a Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" <148610067+eshanized@users.noreply.github.com> Date: Sun, 19 May 2024 04:02:29 +0530 Subject: [PATCH] refactor(check): check for commtizen on push and pull + CODEOWNERS --- .github/CODEOWNERS | 3 +++ .github/workflows/commitizen.yml | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/commitizen.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..5b0fbdb --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# https://help.github.com/articles/about-codeowners/ + +* @eshanized \ No newline at end of file diff --git a/.github/workflows/commitizen.yml b/.github/workflows/commitizen.yml new file mode 100644 index 0000000..ee31a29 --- /dev/null +++ b/.github/workflows/commitizen.yml @@ -0,0 +1,33 @@ +name: Commitizen Check on Push and Pull + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + commitizen_check: + name: Check Commitizen Commit on Push + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: "14" + + - name: Install Commitizen + run: npm install -g commitizen + + - name: Verify Commitizen Commit + run: | + if git log --format='%s' ${{ github.event.before }}..${{ github.sha }} | grep -v '^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .+'; then + echo "Invalid commit message found. Please use Commitizen convention." + exit 1 + fi \ No newline at end of file