🤖 ci(_new): adjusted settings

This commit is contained in:
Eshan Roy
2024-12-13 13:40:29 +05:30
parent 4fcd3fdb88
commit e85ec0432c
3 changed files with 38 additions and 60 deletions

38
.github/workflows/cz.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Check Conventional Commit
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check-commit-message:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check Conventional Commit
run: |
# Define the conventional commit types with emojis
TYPES=("🚀 feat" "🐛 fix" "📝 docs" "✨ style" "🛠 refactor" "⚡️ perf" "🔬 test" "🔧 build" "🤖 ci" "🧹 chore" "⏪ revert")
# Extract the commit type and emoji from the commit message
COMMIT_MSG=$(git log --format=%B -n 1)
for type in "${TYPES[@]}"; do
type_emoji=${type}
type=${type_emoji#* }
emoji=${type_emoji% *}
if [[ $COMMIT_MSG == $emoji* ]]; then
echo "Commit message is a conventional commit"
exit 0
fi
done
# If we reach here, the commit message is not a conventional commit
echo "Commit message is not a conventional commit"
exit 1

View File

@@ -1,30 +0,0 @@
name: Snigdha OS Commitizen Check on Push
on:
push:
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

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