.gitlab-ci.yml: check for dco
This commit is contained in:
parent
999ba0c419
commit
e95e2f9e7a
@ -1,10 +1,21 @@
|
||||
stages:
|
||||
- check-dco
|
||||
- go-fmt
|
||||
- build-src
|
||||
- build-docker
|
||||
- go-test
|
||||
- docker-registry
|
||||
|
||||
check-dco:
|
||||
stage: check-dco
|
||||
image: debian:buster
|
||||
except:
|
||||
- master
|
||||
script:
|
||||
- apt update
|
||||
- apt install -y curl git jq
|
||||
- bash ./scripts/check-dco
|
||||
|
||||
build-src:
|
||||
stage: build-src
|
||||
image: debian:buster
|
||||
|
12
scripts/check-dco
Normal file
12
scripts/check-dco
Normal file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
emails=$(git log master..HEAD --pretty=format:'%ae' | sort | uniq)
|
||||
for email in $emails; do
|
||||
printf "checking %s\n" "$email"
|
||||
if ! curl -s 'https://dco.commento.io/api/has-signed' -d "email=$email" -X POST \
|
||||
| jq '.hasSigned' \
|
||||
| grep -q true; then
|
||||
printf "%s has not signed the DCO: https://dco.commento.io\n" "$email"
|
||||
exit 1
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user