Skip to content

Add CI workflow, DCO check, NOTICE, and CONTRIBUTING #1

Add CI workflow, DCO check, NOTICE, and CONTRIBUTING

Add CI workflow, DCO check, NOTICE, and CONTRIBUTING #1

Workflow file for this run

name: dco
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Require Signed-off-by trailer on every commit
run: |
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
fail=0
for sha in $(git rev-list "$base".."$head"); do
if ! git log -1 --format=%B "$sha" | grep -qE '^Signed-off-by: .+ <.+@.+>$'; then
echo "Commit $sha is missing a Signed-off-by trailer." >&2
fail=1
fi
done
if [[ $fail -ne 0 ]]; then
echo "" >&2
echo "All commits in this PR must be signed off via the DCO." >&2
echo "See CONTRIBUTING.md. Use 'git commit -s' or amend with 'git commit --amend -s'." >&2
exit 1
fi
echo "PASS: all commits carry Signed-off-by trailers."