-
Notifications
You must be signed in to change notification settings - Fork 3
ci: add PR title validation workflow #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdded a GitHub Actions workflow that lints PR titles against a Conventional Commits-style pattern and posts/removes a sticky PR comment; updated CONTRIBUTING and the PR template to document the required PR title format and examples. No functional application code changed. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant GH as GitHub
participant Workflow as pr-title-lint
participant Sticky as StickyComment
User->>GH: Open / Edit / Reopen PR
GH->>Workflow: Trigger workflow (pull_request)
alt Title valid
Workflow->>Workflow: Validate title → pass
Workflow->>Sticky: Delete sticky comment (if present)
Sticky-->>Workflow: Deletion confirmed
else Title invalid
Workflow->>Workflow: Validate title → fail
Workflow->>Sticky: Post or update sticky comment with error + examples
Sticky-->>Workflow: Post confirmed
end
Workflow-->>GH: Complete run
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🪛 LanguageToolCONTRIBUTING.md[style] ~141-~141: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 3585 characters long) (EN_EXCESSIVE_EXCLAMATION) 🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/pull_request_template.md(1 hunks).github/workflows/pr-title-lint.yml(1 hunks)CONTRIBUTING.md(2 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[style] ~134-~134: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 3436 characters long)
Context: ..." or "adds") Breaking changes: Add ! after the type (e.g., feat!: drop Python 3.10 support) If the aut...
(EN_EXCESSIVE_EXCLAMATION)
🪛 markdownlint-cli2 (0.18.1)
CONTRIBUTING.md
117-117: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (5)
CONTRIBUTING.md (1)
113-136: Clear and comprehensive PR title guidance.The "PR Title Format" section provides excellent documentation with format specification, practical examples (both valid and invalid), and clear conventions. Guidance on imperative mood, lowercase descriptions, and breaking changes aligns well with Conventional Commits standards and contributor needs.
.github/pull_request_template.md (1)
1-14: Well‑designed template header with clear examples.The PR template header effectively communicates the title format requirement with practical valid and invalid examples that educate contributors before they submit. The HTML comment approach keeps the guidance visible without interfering with template content.
.github/workflows/pr-title-lint.yml (3)
14-39: Semantic PR action configuration looks solid.The action configuration correctly enforces Conventional Commits with:
- All required types matching documentation
requireScope: falseallowing optional scope- Pattern
^(?![A-Z]).+$correctly rejecting uppercase-starting descriptions- Clear, actionable error messaging
The permissions and trigger events are appropriate.
1-72: Excellent coordination across documentation and automation.The workflow perfectly aligns with CONTRIBUTING.md and the PR template:
- Valid types match exactly across all sources
- Format specification is identical
- Error messaging reinforces documented standards
- Examples in messages match documentation examples
This creates a cohesive contributor experience.
42-72: ✓ The workflow output dependency is valid.The action provides
error_messageas an output, confirming the workflow's assumptions at lines 43, 53, and 69 are correct. The condition logic—posting a comment when the output is non-null (line 43) and deleting it when null (line 69)—aligns with standard GitHub Actions patterns for error reporting.
dbdedc9 to
3cbe79b
Compare
Implement automated enforcement of Conventional Commits specification for pull request titles using GitHub Actions. Changes: - Add pr-title-lint workflow using amannn/action-semantic-pull-request - Configure validation for standard commit types matching commitlint - Add sticky comments to guide contributors on invalid titles - Update CONTRIBUTING.md with PR title format requirements - Add PR template header with title format examples and guidance This ensures PR titles follow the same conventions as commits, which is especially important when using squash merge strategy where the PR title becomes the final commit message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add 'text' language tag to code fence block to satisfy markdownlint requirements. Co-authored-by: Damien Storm <ryderstorm@users.noreply.github.com>
3cbe79b to
c5c463c
Compare
Why?
Enforce Conventional Commits specification for PR titles to maintain consistency and enable automated tooling. This is especially important when using squash merge strategy, where the PR title becomes the final commit message that appears in the repository history.
What Changed?
GitHub Actions Workflow
.github/workflows/pr-title-lint.ymlusingamannn/action-semantic-pull-request@v5feat,fix,docs,style,refactor,perf,test,build,ci,chore,revertDocumentation Updates
CONTRIBUTING.mdwith new "PR Title Format" section!).github/pull_request_template.mdwith title format guidanceAdditional Notes
Next Steps for Full Enforcement:
mainBenefits:
Testing:
This PR itself follows the conventional commit format and will test the new workflow once merged.
Summary by CodeRabbit
Documentation
Chores