mirror of
https://github.com/Snigdha-OS/snigdhaos-assistant.git
synced 2025-09-07 13:15:16 +02:00
🐛 fix(_adj): conv. commit
This commit is contained in:
38
.github/workflows/commit-check.yml
vendored
38
.github/workflows/commit-check.yml
vendored
@@ -1,38 +0,0 @@
|
|||||||
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
|
|
@@ -1,38 +1,38 @@
|
|||||||
name: Check Conventional Commit
|
name: Check Conventional Commit
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-commit-message:
|
check-commit-message:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Check Conventional Commit
|
- name: Check Conventional Commit
|
||||||
run: |
|
run: |
|
||||||
# Define the conventional commit types with emojis
|
# Define the conventional commit types with emojis
|
||||||
TYPES=("🎉 feat" "🐞 fix" "📚 docs" "💅 style" "🔨 refactor" "⚡️ perf" "🧪 test" "🛠️ build" "🤖 ci" "🧹 chore" "⏪️ revert")
|
TYPES=("🚀 feat" "🐛 fix" "📝 docs" "✨ style" "🛠 refactor" "⚡️ perf" "🔬 test" "🔧 build" "🤖 ci" "🧹 chore" "⏪ revert")
|
||||||
|
|
||||||
# Extract the commit type and emoji from the commit message
|
# Extract the commit type and emoji from the commit message
|
||||||
COMMIT_MSG=$(git log --format=%B -n 1)
|
COMMIT_MSG=$(git log --format=%B -n 1)
|
||||||
for type in "${TYPES[@]}"; do
|
for type in "${TYPES[@]}"; do
|
||||||
type_emoji=${type}
|
type_emoji=${type}
|
||||||
type=${type_emoji#* }
|
type=${type_emoji#* }
|
||||||
emoji=${type_emoji% *}
|
emoji=${type_emoji% *}
|
||||||
if [[ $COMMIT_MSG == $emoji* ]]; then
|
if [[ $COMMIT_MSG == $emoji* ]]; then
|
||||||
echo "Commit message is a conventional commit"
|
echo "Commit message is a conventional commit"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If we reach here, the commit message is not a conventional commit
|
# If we reach here, the commit message is not a conventional commit
|
||||||
echo "Commit message is not a conventional commit"
|
echo "Commit message is not a conventional commit"
|
||||||
exit 1
|
exit 1
|
Reference in New Issue
Block a user