-
Notifications
You must be signed in to change notification settings - Fork 168
31 lines (28 loc) · 1.05 KB
/
dco-check.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
30
31
name: DCO Check
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checkout commit logs
run: |
git init
git fetch --filter=blob:none "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF" "$GITHUB_REF"
- name: Check for DCO sign-offs
run: |
no_sign_off="$(git log --no-merges --grep=Signed-off-by --invert-grep "FETCH_HEAD..$GITHUB_SHA")"
if [ -z "$no_sign_off" ]; then
echo "All commits have a Developer Certificate of Origin sign-off"
else
echo "The following commits are missing a Developer Certificate of Origin sign-off;"
echo "see https://github.com/osandov/drgn/blob/main/CONTRIBUTING.rst#signing-off"
echo
echo "$no_sign_off"
exit 1
fi