From fd69beeb42cab10d7ca1f59413ef0cc692d072fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 2 Jul 2018 16:02:35 +0200 Subject: [PATCH] ceph-ansible-pr-syntax-check: add sign-off check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We now fail if the commits don't contain a Signed-off-by certificate. Signed-off-by: Sébastien Han --- ceph-ansible-pr-syntax-check/build/build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ceph-ansible-pr-syntax-check/build/build b/ceph-ansible-pr-syntax-check/build/build index b5f77f5b..e5b3301c 100644 --- a/ceph-ansible-pr-syntax-check/build/build +++ b/ceph-ansible-pr-syntax-check/build/build @@ -46,6 +46,11 @@ function group_vars_check { fi } +function test_sign_off { + test "$(git log --oneline origin/HEAD..HEAD | wc -l)" -ne "$(git log origin/HEAD..HEAD | grep -c Signed-off-by)" && echo "One or more commits is/are missing a Signed-off-by. Add it with 'git commit -s'." + return 1 +} + ######## # MAIN # @@ -54,3 +59,4 @@ cd "$WORKSPACE"/ceph-ansible syntax_check #ansible_lint group_vars_check +test_sign_off -- 2.39.5