Repository navigation
ci: fail pull requests with commits that lack a DCO sign-off - #283
Merged
Merged
Conversation
Add a DCO workflow that reads the pull request's commits from the API and fails when any commit, other than a merge commit, has no Signed-off-by line matching its author's name and email. It runs on pull requests only, skips drafts and title or body edits, needs no checkout and uses only gh and jq from the hosted runner. Document the sign-off and what it certifies in CONTRIBUTING.md. Refs CryptOS-PKI/.github#4 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
10 tasks
This was referenced Sep 30, 2026
Bugs5382
marked this pull request as ready for review
September 30, 2026 03:50
This was referenced Sep 30, 2026
Contributor
Author
|
Closing summary: adds a DCO check on pull requests that fails when a non-merge commit lacks a Signed-off-by line matching its author, and a sign-off section in CONTRIBUTING. Uses only gh and jq, runs on PRs into main, skips drafts. Tracked in CryptOS-PKI/.github#4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
CryptOS-PKI accepts contributions under the Developer Certificate of Origin, and the CNCF IP Policy (charter section 11(b)(ii)) requires a DCO sign-off on all inbound code. This adds a check that enforces it on pull requests.
.github/workflows/job-dco.yaml: a DCO workflow that lists the pull request's commits from the API and fails when any commit, other than a merge commit, has noSigned-off-by:line matching its author's name and email (case-insensitive). It runs on pull requests intomainonly, skips drafts and title or body edits, sets a 5-minute timeout, needs no checkout and uses onlyghandjqfrom the hosted runner, so there is no third-party action to pin. If the API lists fewer commits than the pull request has (it stops at 250), the check fails rather than passing unchecked..github/CONTRIBUTING.md: step 3 now asks forgit commit -s, and a new Developer Certificate of Origin section says what the sign-off certifies and how to fix unsigned commits (git rebase --signoff origin/main).The CONTRIBUTING link to the full certificate text points at the organization guide added in CryptOS-PKI/.github#6, so that one merges first. Sibling pull requests: CryptOS-PKI/api#113, CryptOS-PKI/cryptos-manager#127, CryptOS-PKI/cryptos-web#131, CryptOS-PKI/helm#23, CryptOS-PKI/docs#39.
No docs change: this is contribution tooling, with nothing user-facing on the docs site.
Refs CryptOS-PKI/.github#4
Note
The PR Body check may be red on this pull request for one reason only: it still accepts only same-repository references (
Refs #N), and this change is tracked in another repository. The widened check is in #280 and isn't merged yet.Verification
How this was verified
The step's script was extracted from the workflow and run locally against the GitHub API and against synthetic commit lists (14 cases, all passing):
Before making the check required, note that these open pull requests into
mainhave commits without a sign-off and would fail it until rebased with--signoff: #277, #271.(Re-run after the widened PR-body check and the scoped secret scan merged.)