pref(merge): commitizen check with commitizen.yml (#5)

This commit is contained in:
Eshan Roy (Eshanized)
2024-05-14 03:01:36 +05:30
committed by GitHub
2 changed files with 7 additions and 34 deletions

View File

@@ -1,9 +1,12 @@
name: Snigdha OS Commitizen Check on Push name: Commitizen Check on Push and Pull
on: on:
push: push:
branches: branches:
- master - master
pull_request:
branches:
- master
jobs: jobs:
commitizen_check: commitizen_check:
@@ -13,11 +16,11 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: "14"
- name: Install Commitizen - name: Install Commitizen
run: npm install -g commitizen run: npm install -g commitizen
@@ -27,4 +30,4 @@ jobs:
if git log --format='%s' ${{ github.event.before }}..${{ github.sha }} | grep -v '^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .+'; then 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." echo "Invalid commit message found. Please use Commitizen convention."
exit 1 exit 1
fi fi

View File

@@ -1,30 +0,0 @@
name: Snigdha OS Commitizen Check On Pull
on:
pull_request:
branches:
- master
jobs:
commitizen_check:
name: Check Commitizen Commit on Pull Request
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