Skip to content

[FEATURE] Add a CI action to validate PR naming convention #150

@Miou-zora

Description

@Miou-zora

Problem Statement

When using automatic PR naming during merges, the PR name can sometimes be incorrect. Since commit messages on main are based on PR titles (used for mirroring), an incorrectly named PR causes a non-conventional commit to land on main. There is currently no automated check to enforce the PR naming convention.

Proposed Solution

Add a GitHub Actions workflow that validates the PR title against the project's naming convention (currently the same format as issue titles) and fails the check if it does not comply.

Alternative Solutions

  • Use a bot (e.g., action-semantic-pull-request) from the GitHub Marketplace — quick to set up but adds an external dependency.
  • Enforce naming via branch protection rules only — less precise than a dedicated title check.

Use Cases

  • Use case 1: A contributor opens a PR with a non-conventional title; CI immediately flags it before merge.
  • Use case 2: The merge commit on main always follows the convention, keeping the mirror history clean.

Impact

  • No performance implications.
  • New CI workflow file added — no changes to existing code.
  • No breaking changes.

Implementation Details (optional)

  • Add a workflow triggered on pull_request (types: opened, edited, synchronize).
  • Validate github.event.pull_request.title against the agreed regex (e.g., ^\[FEATURE\]|^\[BUG\]|^\[TASK\]).
  • Fail with a descriptive error message if the title does not match.

Additional Context

N/A

Related Issues

  • N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciEverything related to continous integration

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions