Skip to content

ci: add PR title linting (Conventional Commits)#45

Open
hasansezertasan wants to merge 1 commit into
mainfrom
ci/pr-title
Open

ci: add PR title linting (Conventional Commits)#45
hasansezertasan wants to merge 1 commit into
mainfrom
ci/pr-title

Conversation

@hasansezertasan

@hasansezertasan hasansezertasan commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Adds .github/workflows/pr-title.yml — validates PR titles as Conventional Commits via amannn/action-semantic-pull-request, matching the repo's PR-title convention and enabling downstream label/changelog automation.

Adapted from #16, with two deliberate changes:

Verified: zizmorNo findings to report.

Closes

Summary by Sourcery

CI:

  • Introduce a GitHub Actions workflow that lints PR titles using semantic pull request rules on pull_request events.

Add .github/workflows/pr-title.yml validating PR titles as Conventional
Commits via amannn/action-semantic-pull-request. SHA-pinned,
least-privilege (pull-requests: read), and reads the title via the API
only so the pull_request_target trigger stays safe. Adapted from
#16.

Closes #41
@hasansezertasan hasansezertasan added ci This is CI related github_actions Pull requests that update GitHub Actions code labels Jul 24, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a GitHub Actions workflow to lint pull request titles against Conventional Commits, using a pinned semantic pull request action with hardened permissions and safer triggers for zizmor compliance.

Sequence diagram for PR title linting workflow

sequenceDiagram
  actor Developer
  participant GitHub
  participant workflow_pr_title
  participant action_semantic_pull_request

  Developer->>GitHub: create_or_update_pull_request
  GitHub-->>workflow_pr_title: pull_request opened/edited/synchronize
  workflow_pr_title->>action_semantic_pull_request: job validate uses amannn/action-semantic-pull-request
  action_semantic_pull_request-->>GitHub: report status for PR title check
Loading

File-Level Changes

Change Details Files
Introduce a PR title linting GitHub Actions workflow aligned with Conventional Commits and hardened for least-privilege and zizmor compliance.
  • Add a new workflow triggered on pull_request events (opened, edited, synchronize) to validate PR titles.
  • Configure top-level workflow permissions to an empty set and job-level permissions to pull-requests: read for least privilege.
  • Use amannn/action-semantic-pull-request with a specific pinned commit corresponding to v6.1.1, passing the standard GITHUB_TOKEN via environment.
.github/workflows/pr-title.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#41 Add a CI workflow .github/workflows/pr-title.yml that lints PR titles using amannn/action-semantic-pull-request.
#41 Configure the workflow with hardened security: SHA-pinned action, top-level permissions: {}, and minimal pull-requests: read permissions, avoiding unsafe use of privileged triggers.
#41 Ensure and configure that the allowed Conventional Commit types enforced by the action match the repository’s usage. The workflow uses amannn/action-semantic-pull-request with default settings and does not specify or adjust types/allowed commit types. There is no configuration confirming that the allowed types match the repo’s Conventional Commits usage.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci This is CI related github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add PR title linting (Conventional Commits)

1 participant