Skip to content

Commit d939f25

Browse files
committed
ci(commitlint): fix local running of commit linter on macOS (#656)
Replaces GNU-specific `grep` command-line option in the commitlint check so that the linter would work locally on both macOS and Linux operating systems.
1 parent f095249 commit d939f25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ check_commitlint() {
5858
commit_title=$(echo "$line" | cut -d ' ' -f 2-)
5959
commit_number_of_parents=$(git rev-list --parents "$commit_hash" -n1 | awk '{print NF-1}')
6060
# (i) skip checking release commits generated by Release Please
61-
if [ "$commit_number_of_parents" -le 1 ] && echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
61+
if [ "$commit_number_of_parents" -le 1 ] && echo "$commit_title" | grep -qE "^chore\(.*\): release"; then
6262
continue
6363
fi
6464
# (ii) check presence of PR number
65-
if ! echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
65+
if ! echo "$commit_title" | grep -qE "\(#$pr\)$"; then
6666
echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title"
6767
found=1
6868
fi
6969
# (iii) check absence of merge commits in feature branches
7070
if [ "$commit_number_of_parents" -gt 1 ]; then
71-
if echo "$commit_title" | grep -qP "^chore\(.*\): merge "; then
71+
if echo "$commit_title" | grep -qE "^chore\(.*\): merge "; then
7272
break # skip checking maint-to-master merge commits
7373
else
7474
echo "✖ Merge commits are not allowed in feature branches: $commit_title"

0 commit comments

Comments
 (0)