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 297dd42
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/commit-message-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate commit messages
run: |
# Ensure UTF-8 encoding
export LANG=en_US.UTF-8
# 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 +39,15 @@ jobs:
echo "ℹ️ Checking if commit messages are following the Conventional Commits specification..."
# Loop through each commit message
for COMMIT_MSG in "$COMMITS"; do
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 297dd42

Please sign in to comment.