Merge "Add verify for signed patch"
authorCristina Pauna <cristina.pauna@enea.com>
Fri, 3 May 2019 10:48:17 +0000 (10:48 +0000)
committerGerrit Code Review <gerrit@akraino.org>
Fri, 3 May 2019 10:48:17 +0000 (10:48 +0000)
tox.ini
utils/signed.sh [new file with mode: 0755]

diff --git a/tox.ini b/tox.ini
index f53943c..c6ac867 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,11 +1,17 @@
 [tox]
 minversion = 1.6
 envlist =
+   signedCommit,
    coala,
 skipsdist = true
 passenv = TOX_WORK_DIR
 toxworkdir = {env:TOX_WORK_DIR:/tmp/v}
 
+[testenv:signedCommit]
+whitelist_externals = bash
+commands =
+   bash utils/signed.sh
+
 [testenv:coala]
 basepython = python3
 deps =
diff --git a/utils/signed.sh b/utils/signed.sh
new file mode 100755 (executable)
index 0000000..d5e4e04
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Check that the last commit message contains the "Signed-off-by <>" line
+
+signature="$(git log -1 --show-signature |grep Signed-off-by:)"
+
+if [ -z "$signature" ]; then
+    echo "Signed-off-by is missing from the commit message; please run \"git commit -s --amend\""
+    exit 1
+fi