Skip to content

ci: add PR title linting#1166

Merged
yogeshchoudhary147 merged 5 commits into
mainfrom
ci/lint-pr-title
Jul 19, 2026
Merged

ci: add PR title linting#1166
yogeshchoudhary147 merged 5 commits into
mainfrom
ci/lint-pr-title

Conversation

@yogeshchoudhary147

@yogeshchoudhary147 yogeshchoudhary147 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a GitHub Actions workflow to lint PR titles against the Conventional Commits spec
  • Includes a local composite action (lint-pr-title) with commitlint
  • Adds commitlint.config.mjs at the repo root with standard type rules

Summary by CodeRabbit

  • New Features
    • Added automated pull request title validation using Conventional Commits rules.
    • Validation runs when pull requests are opened, edited, or reopened.
    • Invalid titles now fail checks with clear, actionable guidance (including allowed types and formatting requirements).
  • Chores
    • Introduced a new workflow and local GitHub Action to enforce consistent title standards with read-only repository access.

@yogeshchoudhary147
yogeshchoudhary147 requested a review from a team as a code owner July 18, 2026 02:35
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ad9b2995-aacc-4d71-abcb-630b7d16ad3b

📥 Commits

Reviewing files that changed from the base of the PR and between cef9df7 and 4ec899a.

📒 Files selected for processing (2)
  • .github/actions/lint-pr-title/src/index.js
  • .github/workflows/lint-pr-title.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/lint-pr-title.yml
  • .github/actions/lint-pr-title/src/index.js

📝 Walkthrough

Walkthrough

Adds Conventional Commits rules, a Node 24 local GitHub Action that validates pull request titles, and a workflow triggered when pull requests are opened, edited, or reopened.

Changes

PR title linting

Layer / File(s) Summary
Commitlint rule contract
.github/actions/lint-pr-title/commitlint.config.mjs
Defines allowed title types and formatting rules for type casing, required fields, and subject punctuation.
Lint action implementation
.github/actions/lint-pr-title/action.yml, .github/actions/lint-pr-title/package.json, .github/actions/lint-pr-title/.npmrc, .github/actions/lint-pr-title/src/index.js
Configures the local Node 24 action, declares dependencies, loads the Commitlint configuration, validates pull request titles, formats failures, and reports errors.
Workflow integration
.github/workflows/lint-pr-title.yml
Runs the local action for pull request events with Node 24, read-only contents permissions, dependency installation, and concurrency cancellation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant lint-pr-title.yml
  participant lint-pr-title
  participant commitlint.config.mjs
  PullRequest->>lint-pr-title.yml: opened, edited, or reopened event
  lint-pr-title.yml->>lint-pr-title: execute local action
  lint-pr-title->>commitlint.config.mjs: load rules
  commitlint.config.mjs-->>lint-pr-title: return rules
  lint-pr-title-->>lint-pr-title.yml: pass or set failed
Loading

Possibly related PRs

  • auth0/auth0-react#1132: Updates npm configuration with the same omit-lockfile-registry-resolved=true setting.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding PR title linting in CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/lint-pr-title

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/lint-pr-title.yml (1)

32-34: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Prefer npm ci over npm install in CI environments.

Using npm install can result in non-deterministic builds because it might update your package-lock.json or install different dependency versions. For CI environments, it's highly recommended to commit the package-lock.json file for the action and use npm ci to ensure reproducible dependency resolution.

♻️ Proposed refactor
       - name: Install action dependencies
-        run: npm install --ignore-scripts
+        run: npm ci --ignore-scripts
         working-directory: .github/actions/lint-pr-title
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint-pr-title.yml around lines 32 - 34, Update the
“Install action dependencies” step in the lint-pr-title workflow to use npm ci
instead of npm install, while preserving the existing --ignore-scripts flag and
working-directory.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/lint-pr-title/src/index.js:
- Around line 30-33: Update the lint call in the action’s main flow to pass the
resolved parserOpts from load() into `@commitlint/lint` alongside config.rules,
defaultIgnores, and helpUrl. Reuse the parser options already returned or
resolved by load(), ensuring PR titles are parsed with the configured grammar.

In @.github/workflows/lint-pr-title.yml:
- Around line 24-25: Update the actions/checkout step in the PR-title lint
workflow to explicitly disable credential persistence using the checkout
action’s persist-credentials setting. Leave the existing pinned action version
and other checkout behavior unchanged.

---

Nitpick comments:
In @.github/workflows/lint-pr-title.yml:
- Around line 32-34: Update the “Install action dependencies” step in the
lint-pr-title workflow to use npm ci instead of npm install, while preserving
the existing --ignore-scripts flag and working-directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cc002a3-e11f-45c7-bc03-062555c82d9e

📥 Commits

Reviewing files that changed from the base of the PR and between 52f7687 and 4bab6b7.

📒 Files selected for processing (5)
  • .github/actions/lint-pr-title/action.yml
  • .github/actions/lint-pr-title/package.json
  • .github/actions/lint-pr-title/src/index.js
  • .github/workflows/lint-pr-title.yml
  • commitlint.config.mjs

Comment thread .github/actions/lint-pr-title/src/index.js
Comment thread .github/workflows/lint-pr-title.yml
Comment thread .github/actions/lint-pr-title/commitlint.config.mjs
Comment thread .github/actions/lint-pr-title/package.json
Comment thread .github/workflows/lint-pr-title.yml
Comment thread .github/actions/lint-pr-title/src/index.js Outdated
@yogeshchoudhary147 yogeshchoudhary147 changed the title ci: add PR title linting add PR title linting Jul 18, 2026
@yogeshchoudhary147 yogeshchoudhary147 changed the title add PR title linting ci: add PR title linting Jul 18, 2026
Comment thread .github/workflows/lint-pr-title.yml
@yogeshchoudhary147
yogeshchoudhary147 merged commit 75c5ef2 into main Jul 19, 2026
15 of 16 checks passed
@yogeshchoudhary147
yogeshchoudhary147 deleted the ci/lint-pr-title branch July 19, 2026 17:53
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