🐞 fix(alt): remove npm

This commit is contained in:
Eshan Roy (Eshanized)
2024-06-18 03:35:06 +05:30
parent 18f2aa7132
commit be5362360f

View File

@@ -1,27 +1,35 @@
name: Conventional Commit Check
name: Check Conventional Commit
on:
push:
branches:
- master # Adjust to match your main branch name
- main
jobs:
check-commits:
check-commit-message:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check Conventional Commit
run: |
# Define the conventional commit types with emojis
TYPES=("🎉 feat" "🐞 fix" "📚 docs" "💅 style" "🔨 refactor" "⚡️ perf" "🧪 test" "🛠️ build" "🤖 ci" "🧹 chore" "⏪️ revert")
- name: Install dependencies
run: npm install # Ensure to have npm dependencies set up
# 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
- name: Run commit script
run: bash ./push.sh
# You can add additional steps here for testing, linting, etc.
# If we reach here, the commit message is not a conventional commit
echo "Commit message is not a conventional commit"
exit 1