Skip to content

ci: enforce conventional commit format on PR titles#70

Merged
ian-flores merged 2 commits intomainfrom
enforce-pr-title-format
Feb 4, 2026
Merged

ci: enforce conventional commit format on PR titles#70
ian-flores merged 2 commits intomainfrom
enforce-pr-title-format

Conversation

@ian-flores
Copy link
Collaborator

@ian-flores ian-flores commented Feb 4, 2026

Summary

  • Adds a GitHub Action that validates PR titles follow conventional commit format
  • Updates CONTRIBUTING.md and CLAUDE.md to document the requirement

Context

semantic-release was skipping releases because commits weren't following conventional format (e.g., PR #66's "fix tests" instead of "fix: tests").

With this change:

  1. PR titles are validated by CI - must start with feat:, fix:, docs:, etc.
  2. Combined with squash merge (repo setting), the PR title becomes the commit message
  3. semantic-release can then properly analyze commits for version bumps

Checklist

  • CI workflow added (.github/workflows/pr-title.yml)
  • CONTRIBUTING.md updated with enforcement details
  • CLAUDE.md updated with summary
  • Manual step required: Enable "Squash and merge only" in repo settings (Settings → General → Pull Requests)

Test plan

  • Open a PR with invalid title (e.g., "add feature") - should fail CI
  • Open a PR with valid title (e.g., "feat: add feature") - should pass CI

Adds a GitHub Action that validates PR titles follow conventional
commit format (feat:, fix:, docs:, etc.). This ensures squash merges
produce commits that semantic-release can analyze for version bumps.

Required because semantic-release was skipping releases when commits
didn't follow the convention (e.g., PR #66's "fix tests" instead of
"fix: tests").
- Update CONTRIBUTING.md to clarify PR titles are validated by CI
- Explain squash merge strategy and how it affects releases
- Add PR Title Check to CI checks list
- Update CLAUDE.md with summary of PR title requirements
@claude
Copy link

claude bot commented Feb 4, 2026

Claude finished @ian-flores's task —— View job


Reviewing PR

  • Read review guidelines
  • Create pending review
  • Get PR diff and analyze changes
  • Add inline review comments
  • Submit review

Review submitted with feedback on:

  • Version pinning suggestion for the GitHub Action
  • Minor documentation enhancement idea
  • Confirmation that changes follow existing patterns and have no security concerns

Note: I was unable to add inline comments due to permissions, so feedback was included in the review body instead.

@ian-flores ian-flores marked this pull request as ready for review February 4, 2026 17:09
@ian-flores ian-flores requested a review from stevenolen February 4, 2026 17:09
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR adds CI enforcement for PR title conventions, which solves a real problem (semantic-release skipping releases due to non-conforming commits). The implementation is solid and follows existing patterns.

What's Good:

  • Uses amannn/action-semantic-pull-request@v5, a well-maintained action for this purpose
  • Documentation updates in CONTRIBUTING.md are thorough and explain the "why" behind the requirement
  • The workflow triggers on appropriate events (opened, edited, synchronize, reopened)
  • CLAUDE.md update is appropriately concise

Minor Suggestions:

  1. Version pinning (.github/workflows/pr-title.yml:23): Consider pinning to a specific version (e.g., @v5.4.2) with Dependabot for updates. This improves security and reproducibility. The @v5 pattern is acceptable but less secure.

  2. Header comment examples (.github/workflows/pr-title.yml:1-10): The examples in the header are helpful. Consider adding one with a scope, e.g., fix(api): fix validation bug to show the optional scope syntax.

Checklist:

  • Follows existing CI workflow patterns
  • Documentation is clear and actionable
  • No security concerns with the changes

Note for merging: The PR description mentions enabling "Squash and merge only" in repo settings. Ensure this is done before relying on this enforcement.

@ian-flores ian-flores merged commit 3a39865 into main Feb 4, 2026
5 checks passed
@ian-flores ian-flores deleted the enforce-pr-title-format branch February 4, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants