From 46fc8a550f975428831b35ca241901b9bb81fee0 Mon Sep 17 00:00:00 2001 From: "Florian Amette (F4K)" <50982737+florianamette@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:59:54 -0500 Subject: [PATCH 1/2] ci: require a DCO sign-off on every pull request commit CONTRIBUTING.md has asked for 'git commit -s' all along, but nothing checked it and most commits carry no sign-off. This workflow fails a pull request whose commits lack a Signed-off-by line with the author's email; merge commits and bots are exempt. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AuFi2XQ6ctHQ1eNQ4Fz8ud Signed-off-by: Florian Amette (F4K) <50982737+florianamette@users.noreply.github.com> --- .github/workflows/dco.yml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/dco.yml diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 0000000..67cf8c3 --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,42 @@ +name: DCO + +# Every commit in a pull request must carry a Developer Certificate of Origin sign-off +# (`Signed-off-by: Name `, added by `git commit -s`) whose email is the commit +# author's. CONTRIBUTING.md explains why; ADR-0047 records the licensing it supports. +# Merge commits and bot commits (Dependabot) are exempt. + +on: + pull_request: + +permissions: + contents: read + +jobs: + dco: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - name: Every commit is signed off by its author + env: + BASE: ${{ github.event.pull_request.base.sha }} + HEAD: ${{ github.event.pull_request.head.sha }} + run: | + missing=0 + for c in $(git rev-list --no-merges "$BASE..$HEAD"); do + email=$(git log -1 --format=%ae "$c") + case "$email" in + *'[bot]@users.noreply.github.com') continue ;; + esac + if ! git log -1 --format=%B "$c" | grep -i '^Signed-off-by:' | grep -qiF "<$email>"; then + echo "::error::$(git log -1 --format='%h %s' "$c"): no 'Signed-off-by: ... <$email>' line" + missing=1 + fi + done + if [ "$missing" = 1 ]; then + echo "Sign off your commits: 'git commit -s' for new ones, 'git rebase --signoff $BASE' for these, then force-push." + exit 1 + fi + echo "All commits are signed off." From 030cbf13230e06a288455b3d9a0ab96f1b9c2920 Mon Sep 17 00:00:00 2001 From: "Florian Amette (F4K)" <50982737+florianamette@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:11:43 -0500 Subject: [PATCH 2/2] ci(dco): point at CONTRIBUTING.md only Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AuFi2XQ6ctHQ1eNQ4Fz8ud Signed-off-by: Florian Amette (F4K) <50982737+florianamette@users.noreply.github.com> --- .github/workflows/dco.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index 67cf8c3..4356d4a 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -2,7 +2,7 @@ name: DCO # Every commit in a pull request must carry a Developer Certificate of Origin sign-off # (`Signed-off-by: Name `, added by `git commit -s`) whose email is the commit -# author's. CONTRIBUTING.md explains why; ADR-0047 records the licensing it supports. +# author's. CONTRIBUTING.md explains why (see "Licensing of your contribution"). # Merge commits and bot commits (Dependabot) are exempt. on: