From 1e8d80325a2a6c760b1d7f7bbd6ce10f2213054a Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" Date: Fri, 10 May 2024 02:41:16 +0530 Subject: [PATCH] chore(add): add commitizen validation workflow --- .github/workflows/commitizen.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/commitizen.yml diff --git a/.github/workflows/commitizen.yml b/.github/workflows/commitizen.yml new file mode 100644 index 0000000..ac93cb1 --- /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