summaryrefslogtreecommitdiff
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-14 09:38:59 +0100
commita5e40f90392397cb1b2df6846f57c3b39efaace1 (patch)
treec750ca0475461760d898048a0d17a4f1503c1968
parentd5d62a7d83d558c0ab5b1a4b633655b852ff3c55 (diff)
downloadgnutls-tmp-check-if-signed.tar.gz
Check for Signed-off-by: in CItmp-check-if-signed
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--.gitlab-ci.yml18
-rwxr-xr-xdevel/check_if_signed18
2 files changed, 36 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6a7652ddeb..cc67461034 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,6 +31,7 @@ variables:
DEBIAN_X86_CROSS_BUILD: buildenv-debian-x86-cross
FEDORA28_BUILD: buildenv-f28
FEDORA_BUILD: buildenv-f29
+ ALPINE_BASE_BUILD: buildenv-alpine-base
CPPCHECK_OPTIONS: "--enable=warning --enable=style --enable=performance --enable=portability --std=c99 --suppressions-list=devel/cppcheck.suppressions --template='{id}:{file}:{line},{severity},{message}'"
GET_SOURCES_ATTEMPTS: "3"
@@ -38,6 +39,23 @@ variables:
# Stage 1, documentation, and advanced checks
##################################################
+commit-check:
+ stage: stage1-testing
+ image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$ALPINE_BASE_BUILD
+ before_script:
+ - /bin/true
+ after_script:
+ - /bin/true
+ cache:
+ # do not load cache files
+ key: none
+ policy: pull
+ script:
+ # we want $ALPINE_BASE_BUILD without git, so add it here
+ - apk add git
+ - devel/check_if_signed
+ retry: 0
+
doc-dist.Fedora:
stage: stage1-testing
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
diff --git a/devel/check_if_signed b/devel/check_if_signed
new file mode 100755
index 0000000000..81cc79e5fc
--- /dev/null
+++ b/devel/check_if_signed
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+
+# create list of commits of the current branch
+commits=$(git rev-list --no-merges master..)
+
+# 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