From 30a267c83d2080a922f0a283bf27f25be1211860 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 6 Mar 2020 18:14:17 +0000 Subject: [PATCH] ci: check if commit message contains fixup on travis --- .travis.yml | 1 + ci/check_fixup.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100755 ci/check_fixup.sh diff --git a/.travis.yml b/.travis.yml index 5d18afc4c..cff75e1b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ script: - pipenv run make style_check - pipenv run make defs_check - pipenv run make gen_check + - ci/check_fixup.sh notifications: webhooks: diff --git a/ci/check_fixup.sh b/ci/check_fixup.sh new file mode 100755 index 000000000..ed43b0a4b --- /dev/null +++ b/ci/check_fixup.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +git fetch origin master:master # on CIs it is common to fetch only the current branch + +messages=$(git log --format=%s master..) # commit messages between this branch and master + +if [[ $messages =~ "fixup!" ]]; then + echo 'Failure: Some commit message contains "fixup!" string.' + exit 1 +else + echo 'Success: No commit messages containing "fixup!" string.' +fi