File tree 1 file changed +33
-0
lines changed 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -325,3 +325,36 @@ 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
+ COMMITLIST=/tmp/commitlist.txt
337
+ git log --format="%s" ${{ github.event.pull_request.base.ref }}..HEAD >$COMMITLIST
338
+
339
+ echo "Commit list:"
340
+ cat $COMMITLIST
341
+
342
+ # fixup commits should never be merged:
343
+ if grep -F 'fixup!' $COMMITLIST; then
344
+ echo "Fixup commits found"
345
+ exit 1
346
+ fi
347
+
348
+ # No Merge commits to be merged:
349
+ if grep 'Merge branch.*into' $COMMITLIST; then
350
+ echo "Merge commits found"
351
+ exit 1
352
+ fi
353
+
354
+ # require a ":" to appear somewhere in the message:
355
+ while IFS= read x; do
356
+ if ! [[ "$x" == *":"* ]] ; then
357
+ echo "Commit message ($x) missing subsystem tag on front"
358
+ exit 1
359
+ fi
360
+ done < $COMMITLIST
You can’t perform that action at this time.
0 commit comments