@@ -25,20 +25,29 @@ exit_code=0
2525# Call with an ancestor whereas all commits newer than the ancestor are checked.
2626base=" $1 "
2727if [ -z " $base " ]; then
28- commits=" $( git rev-list --reverse HEAD) "
28+ commits=" $( git rev-list --no-merges -- reverse HEAD) "
2929else
30- commits=" $( git rev-list --reverse $base ..HEAD) "
30+ commits=" $( git rev-list --no-merges -- reverse $base ..HEAD) "
3131fi
3232
33+ echo " Current commit: $( git show $( git rev-parse HEAD) ) "
34+ git log -n 5
3335# Authors found in commits and NOTICE.
3436declare -A known_authors
3537# Authors found only in commits but not NOTICE file.
3638declare -A assumed_authors
3739
3840for c in $commits ; do
3941 author=$( git show -s --format=' %an <%ae>' $c )
40- # Check Signed-Off-By message
41- if ! git show -s --format=' %B' $c | grep -wq " Signed-off-by: $author " ; then
42+ msg=$( git show -s --format=' %B' $c )
43+ echo " Checking commit: $c "
44+
45+ # Do not check automatically created merge commits in the GitHub CI for a 'Signed-Off-By' message.
46+ # They still need to be created with a valid author email.
47+ # *@users.noreply.github.com authors is not allowed.
48+ if [ -n " $GITHUB_WORKSPACE " ] && (echo " $msg " | egrep -wq " ^[[:space:]]*Merge [[:xdigit:]]{40} into [[:xdigit:]]{40}[[:space:]]*$" ); then
49+ echo " Skipping GitHub CI merge commit: $c "
50+ elif ! echo " $msg " | grep -wq " Signed-off-by: $author " ; then
4251 echo " Commit $c is missing or has wrong 'Signed-off-by' message."
4352 exit_code=1
4453 fi
@@ -68,4 +77,5 @@ for c in $commits; do
6877 fi
6978done
7079
80+ echo " Check exit code: $exit_code "
7181exit $exit_code
0 commit comments