-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (26 loc) · 794 Bytes
/
Copy pathdco.yml
File metadata and controls
27 lines (26 loc) · 794 Bytes
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
name: DCO
on:
pull_request:
jobs:
dco:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check DCO sign-off
run: |
BASE=${{ github.event.pull_request.base.sha }}
HEAD=${{ github.event.pull_request.head.sha }}
MISSING=$(git log --format='%H %s' ${BASE}..${HEAD} | while read hash msg; do
if ! git log -1 --format='%b' $hash | grep -qi 'Signed-off-by:'; then
echo "$hash $msg"
fi
done)
if [ -n "$MISSING" ]; then
echo "The following commits are missing DCO sign-off:"
echo "$MISSING"
echo ""
echo "Add sign-off with: git commit --amend -s"
exit 1
fi