Skip to content

Commit

Permalink
feat: set regex of commit labelling
Browse files Browse the repository at this point in the history
  • Loading branch information
lfbarrile01 committed Jan 22, 2025
1 parent 6003b11 commit 3b64060
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/commit-labelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@ jobs:
- name: Check Commit Messages for "fix", "feat", "chore", or "release"
run: |
if [[ "$COMMIT_MESSAGE" =~ ^(fix|feat|chore|release) ]]; then
if [[ "$COMMIT_MESSAGE" =~ ^fix ]]; then
echo "Commit is a FIX. Proceed with color labeling!"
echo "![Fix Badge](https://img.shields.io/badge/Fix-%23FF5733)"
elif [[ "$COMMIT_MESSAGE" =~ ^feat ]]; then
echo "Commit is a FEATURE. Proceed with color labeling!"
echo "![Feature Badge](https://img.shields.io/badge/Feature-%234CAF50)"
elif [[ "$COMMIT_MESSAGE" =~ ^chore ]]; then
echo "Commit is a CHORE. Proceed with color labeling!"
echo "![Chore Badge](https://img.shields.io/badge/Chore-%23FF9800)"
elif [[ "$COMMIT_MESSAGE" =~ ^release ]]; then
echo "Commit is a RELEASE. Proceed with color labeling!"
echo "![Release Badge](https://img.shields.io/badge/Release-%237E57C2)"
fi
if [[ "$COMMIT_MESSAGE" =~ ^fix ]]; then
echo "Commit is a FIX. Proceed with color labeling!"
echo "![Fix Badge](https://img.shields.io/badge/Fix-%23FF5733)"
elif [[ "$COMMIT_MESSAGE" =~ ^feat ]]; then
echo "Commit is a FEATURE. Proceed with color labeling!"
echo "![Feature Badge](https://img.shields.io/badge/Feature-%234CAF50)"
elif [[ "$COMMIT_MESSAGE" =~ ^chore ]]; then
echo "Commit is a CHORE. Proceed with color labeling!"
echo "![Chore Badge](https://img.shields.io/badge/Chore-%23FF9800)"
elif [[ "$COMMIT_MESSAGE" =~ ^release ]]; then
echo "Commit is a RELEASE. Proceed with color labeling!"
echo "![Release Badge](https://img.shields.io/badge/Release-%237E57C2)"
else
echo "Commit does not match 'fix', 'feat', 'chore', or 'release'. No action."
fi

0 comments on commit 3b64060

Please sign in to comment.