mirror of
https://github.com/Snigdha-OS/snigdhaos-kernel-switcher.git
synced 2025-09-06 23:25:12 +02:00
🐞 fix(_invalid): valid commitizen and update
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
|||||||
@iconized
|
@iconized @eshanized
|
37
.github/workflows/commitizen.yml
vendored
37
.github/workflows/commitizen.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: EZCommits Check on Push and Pull
|
name: Check Conventional Commit
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,25 +9,30 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
commitizen_check:
|
check-commit-message:
|
||||||
name: Check EZCommits Commit on Push
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Check Conventional Commit
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "14"
|
|
||||||
|
|
||||||
- name: Install Commitizen
|
|
||||||
run: npm install -g commitizen
|
|
||||||
|
|
||||||
- name: Verify Commitizen Commit
|
|
||||||
run: |
|
run: |
|
||||||
if git log --format='%s' ${{ github.event.before }}..${{ github.sha }} | grep -v '^(feat|fix|docs|style|refactor|perf|test|chore|wip|ci)(\(.+\))?: .+'; then
|
# Define the conventional commit types with emojis
|
||||||
echo "Invalid commit message found. Please use Commitizen convention."
|
TYPES=("🎉 feat" "🐞 fix" "📚 docs" "💅 style" "🔨 refactor" "⚡️ perf" "🧪 test" "🛠️ build" "🤖 ci" "🧹 chore" "⏪️ revert")
|
||||||
exit 1
|
|
||||||
|
# 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
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# If we reach here, the commit message is not a conventional commit
|
||||||
|
echo "Commit message is not a conventional commit"
|
||||||
|
exit 1
|
Reference in New Issue
Block a user