summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-01-10 14:53:32 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2019-01-20 13:20:41 +0100
commit3a1ec182a38e372e03887bc231b7d3766aaa134f (patch)
tree643d98685ee0d783c478cb59a171363253dd5c94 /devel
parentdfc3780b3efa0ff99daecd7d43078a45050e818b (diff)
downloadgnutls-3a1ec182a38e372e03887bc231b7d3766aaa134f.tar.gz
Check for Signed-off-by: in CI
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'devel')
-rwxr-xr-xdevel/check_if_signed25
1 files changed, 25 insertions, 0 deletions
diff --git a/devel/check_if_signed b/devel/check_if_signed
new file mode 100755
index 0000000000..a053bbc0c8
--- /dev/null
+++ b/devel/check_if_signed
@@ -0,0 +1,25 @@
+#!/usr/bin/env sh
+
+if test -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"; then
+ CI_MERGE_REQUEST_TARGET_BRANCH_NAME="master"
+fi
+
+echo "target=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
+echo "source=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
+
+# create list of commits of the current branch
+commits=$(git rev-list --no-merges $CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME)
+
+# check if author's email matches email in 'Signed-off-by'
+for hash in $commits; do
+ author=$(git log --format='%ae' ${hash}^\!)
+ signed=$(git log --format='%b' ${hash}^\! | grep -i "Signed-off-by:")
+ if test $? -ne 0; then
+ echo "Missing Signed-off-by"
+ exit 1
+ fi
+ if ! echo $signed | grep -q "Signed-off-by:.*<${author}>"; then
+ echo "Author '${author}' doesn't match"
+ exit 1
+ fi
+done