Repository navigation
ci: require conventional commits and DCO sign-offs - #9
Merged
Merged
Conversation
Signed-off-by: cc <cclonelycc@outlook.com>
ZhouAo-ZA
approved these changes
Oct 9, 2026
pppppppppper
approved these changes
Oct 9, 2026
3 tasks done
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.
Summary
Require Conventional Commits 1.0 subjects and DCO 1.1 sign-offs for every commit introduced by a PR, plus a compliant PR title. Document the categories, optional scopes, breaking-change markers, 72-character subject limit, message layout, author/coauthor identity matching, and repair commands in the contribution guide and PR checklist.
Add one lightweight
Commit policyjob using only Python's standard library and Git. It checks the event's actual base/head range, including contributor-authored merges, and uses Git's trailer parser so a sign-off buried in prose does not pass. PR edits rerun this check; existing CPU/lint/docs workflows and the path-filtered Recipe jobs are unchanged. Existing main history and GitHub's temporary test-merge commit are excluded.Verification
.venv/bin/pytest -q tests/test_commit_policy.py: 20 passed, using real temporary Git histories. Covers unsigned earlier commits, mismatched/malformed/nonterminal sign-offs, coauthors, authored merges, invalid subjects/body layout, event head/title handling, and invalid/empty ranges..venv/bin/ruff check scripts/check_commit_policy.py tests/test_commit_policy.py: passed..venv/bin/ruff format --check scripts/check_commit_policy.py tests/test_commit_policy.py: passed.mkdocs build --strict: passed.git diff --check: passed.Enforcement and rollout
Main's branch protection now requires
Commit policyfrom the GitHub Actions app. Its existing two-review requirement, stale-review dismissal, and enforcement for administrators are preserved. This new check does not add a requirement for branches to be up to date.Merge this PR to make the policy workflow available to other PRs. Existing PRs must trigger a new policy run (for example, by updating their branch or reopening the PR) and fix any violations; merged main history is not rewritten or retroactively signed off.
Maintainers must retain DCO trailers and use compliant messages when squashing, rebasing, or creating final merge commits; the PR job cannot inspect a future GitHub-generated merge commit.
Checklist