From 0dcb8c210805df2cf196a959e90ebc00d31012bc Mon Sep 17 00:00:00 2001 From: Augustina Ragwitz Date: Tue, 20 Jun 2017 17:11:06 -0700 Subject: [PATCH] Check signed off by via TravisCI Closes Issue #13 --- .travis.yml | 8 ++++++++ tests/check_signed_off_by.sh | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .travis.yml create mode 100755 tests/check_signed_off_by.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..de7ef5c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: python +dist: trusty +python: + - 3.6 +jobs: + include: + - stage: check commit + script: tests/check_signed_off_by.sh diff --git a/tests/check_signed_off_by.sh b/tests/check_signed_off_by.sh new file mode 100755 index 0000000..3467580 --- /dev/null +++ b/tests/check_signed_off_by.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Copied from BonnyCI/hoist + +success="true" + +for commit in $(git cherry master | cut -d " " -f 2) +do + if ! git show -s "$commit" | grep -q 'Signed-off-by:'; then + echo "Commit $commit doesn't have a Signed-off-by" + git show "$commit" + success="false" + fi +done + +if [ "$success" = "true" ]; then + echo "All commits have a Signed-off-by" +else + echo "Some commits do not have a Signed-off-by, failing..." + echo "Fix is probably (git commit --amend -s)" + exit 1 +fi