Skip to content

Commit

Permalink
baaaaad commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joc-a committed Feb 5, 2025
1 parent a642aed commit 7cd04b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/commit-message-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
# Ensure UTF-8 encoding
export LANG=en_US.UTF-8
echo -e "✅ Good commit message"
echo -e "❌ Bad commit message"
# Regex for Conventional Commits specification
COMMIT_REGEX="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^\)]*\))?:\s?(EXPOSED-[0-9]+\s?)?.+$"
Expand All @@ -44,14 +47,15 @@ jobs:
echo "ℹ️ Checking if commit messages are following the Conventional Commits specification..."
# Loop through each commit message
IFS=$'\n'
for COMMIT_MSG in "$COMMITS"; do
# Check if commit message matches the regex
if [[ ! "$COMMIT_MSG" =~ $COMMIT_REGEX ]]; then
INVALID_COMMITS+=("$COMMIT_MSG")
echo "❌ $COMMIT_MSG"
echo -e "❌ $COMMIT_MSG"
else
VALID_COMMITS+=("$COMMIT_MSG")
echo "✅ $COMMIT_MSG"
echo -e "✔ ✅$COMMIT_MSG"
fi
done
Expand Down

0 comments on commit 7cd04b7

Please sign in to comment.