Skip to content

ci: add conventional commit enforcement for PR titles#200

Open
anchitrao wants to merge 2 commits intomainfrom
chore/enforce-conventional-commits
Open

ci: add conventional commit enforcement for PR titles#200
anchitrao wants to merge 2 commits intomainfrom
chore/enforce-conventional-commits

Conversation

@anchitrao
Copy link
Copy Markdown

@anchitrao anchitrao commented Apr 16, 2026

Summary

  • Adds a GitHub Actions workflow (lint-pr.yaml) that validates PR titles follow Conventional Commits format before merging to main
  • Uses amannn/[email protected] (pinned to SHA), matching the existing setup in the SGP and agentex (private) repositories
  • Supports types: feat, fix, docs, style, refactor, test, chore, ci, build, perf, revert
  • Includes a skip-conventional-commit-check label escape hatch for bot/automated PRs

Note

After merging, add Validate PR title (Conventional Commits) as a required status check in the branch protection rules for main (Settings → Branches → main rule → Require status checks). Without this, the workflow will run but won't block non-compliant PRs.

Test plan

  • Verify the workflow runs on this PR
  • Confirm it passes since this PR title follows conventional commit format

Greptile Summary

This PR adds a GitHub Actions workflow (lint-pr.yaml) to enforce Conventional Commits formatting on PR titles, and updates CONTRIBUTING.md to document the new requirement. The workflow is well-structured: it uses a SHA-pinned action, declares minimal permissions (statuses: write, pull-requests: read), covers all relevant PR trigger events, and provides a label-based escape hatch for bot PRs.

Confidence Score: 5/5

Safe to merge — clean CI addition with no logic issues, correct permissions, and good documentation.

Both changed files are straightforward: a new workflow with a SHA-pinned action and minimal permissions, and updated docs. No P0 or P1 findings. The one nuance (CONTRIBUTING.md states the check will block merges before branch protection is configured) is acknowledged in the PR description and is P2 at most.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/lint-pr.yaml New workflow enforcing conventional commit format on PR titles; SHA-pinned action, correct minimal permissions, full event coverage, and label escape hatch — no issues found.
CONTRIBUTING.md Commit message section updated to document the new Conventional Commits requirement with clear format, allowed types, and examples matching the workflow config.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant WF as lint-pr workflow
    participant Action as action-semantic-pull-request

    Dev->>GH: Open / Edit / Sync PR
    GH->>WF: Trigger (pull_request event)
    WF->>Action: Run with GITHUB_TOKEN + PR title
    alt Title matches conventional commit format
        Action->>GH: Post ✅ status check (pass)
    else Title does NOT match
        Action->>GH: Post ❌ status check (fail)
    end
    alt PR has skip-conventional-commit-check label
        Action->>GH: Skip check entirely
    end
Loading

Reviews (2): Last reviewed commit: "docs: update CONTRIBUTING.md with conven..." | Re-trigger Greptile

Uses amannn/action-semantic-pull-request to validate PR titles
follow conventional commit format before merging to main,
matching the setup in the SGP repository.
@anchitrao anchitrao requested a review from a team as a code owner April 16, 2026 15:49
Copy link
Copy Markdown
Collaborator

@declan-scale declan-scale left a comment

Choose a reason for hiding this comment

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

Can we add a quick blurb to the CONTRIBUTING.md

@anchitrao
Copy link
Copy Markdown
Author

Can we add a quick blurb to the CONTRIBUTING.md

done

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