-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dco.yml
29 lines (25 loc) · 851 Bytes
/
dco.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pipeline:
dco:
image: alpine
commands:
- apk add git
- git version
- git fetch --no-tags origin +refs/heads/main
- |
set -e
function on_err {
[ $? -eq 0 ] && exit
cat <<EOF
Failed to sign the Developer Certificate of Origin (DCO)!
Please read the file "DCO" and then, if you agree, sign each of your commits
using:
git commit -s
Or quickly sign the previous commit with:
git commit --amend -s --no-edit
EOF
exit 1
}
trap on_err EXIT
# Check that all commits that aren't in main are signed off by the same
# committer (taken from the HEAD commit).
[[ ! "$(git log --pretty="%an <%ae>%n%(trailers:key=Signed-off-by,valueonly,separator=)" origin/main.. | uniq -u)" ]]