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