gitlab-ci: Make sure commits are signed-off before merge
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>merge-requests/46/head
parent
bc2c925c7a
commit
d734fccc39
|
@ -0,0 +1,20 @@
|
||||||
|
variables:
|
||||||
|
GITLAB_CI_IMAGE_ALPINE: 'alpine:3.16.1'
|
||||||
|
GITLAB_CI_SIGN_OFF_EXCLUDE: '40de4742d5277525f4b0e387121bd3c2c0ad323f'
|
||||||
|
stages:
|
||||||
|
- static
|
||||||
|
|
||||||
|
# 'static' stage
|
||||||
|
sign_off:
|
||||||
|
stage: static
|
||||||
|
needs: []
|
||||||
|
image: ${GITLAB_CI_IMAGE_ALPINE}
|
||||||
|
before_script:
|
||||||
|
- apk add --no-cache git
|
||||||
|
script: >-
|
||||||
|
git log
|
||||||
|
--grep "^Signed-off-by: .\+<.\+\(@\| at \).\+\(\.\| dot \).\+>$"
|
||||||
|
--invert-grep
|
||||||
|
--format="Detected commit '%h' with missing or bad sign-off! Please read 'CONTRIBUTING.md'."
|
||||||
|
--exit-code
|
||||||
|
"$(rev=$(git rev-parse -q --verify "$GITLAB_CI_SIGN_OFF_EXCLUDE^{commit}") && echo "$rev..")"
|
Loading…
Reference in New Issue