File tree 1 file changed +29
-0
lines changed 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -325,3 +325,32 @@ jobs:
325
325
else
326
326
echo "No differences found." >> $GITHUB_STEP_SUMMARY
327
327
fi
328
+
329
+ - name : Check commitlist ${{ github.event.pull_request.base.ref }}..HEAD
330
+ shell : bash
331
+ run : |
332
+ set -ex
333
+ git config --global --add safe.directory ${GITHUB_WORKSPACE}
334
+
335
+ # create file to inspect
336
+ git log --format="%s" ${{ github.event.pull_request.base.ref }}..HEAD >/tmp/commitlist.txt
337
+
338
+ # fixup commits should never be merged:
339
+ if grep -F 'fixup!' /tmp/commitlist; then
340
+ echo "Fixup commits found"
341
+ exit 1
342
+ fi
343
+
344
+ # No Merge commits to be merged:
345
+ if grep 'Merge branch.*into' /tmp/commitlist; then
346
+ echo "Merge commits found"
347
+ exit 1
348
+ fi
349
+
350
+ # require a ":" to appear somewhere in the message:
351
+ while IFS= read x; do
352
+ if ! [[ "$x" == *":"* ]] ; then
353
+ echo "Commit message ($x) missing subsystem tag on front"
354
+ exit 1
355
+ fi
356
+ done < /tmp/commitlist
You can’t perform that action at this time.
0 commit comments