Skip to content

feat(repo): add GitHub Actions workflow to validate PR titles#32458

Merged
AgentEnder merged 1 commit intomasterfrom
feat/pr-title-validation
Aug 21, 2025
Merged

feat(repo): add GitHub Actions workflow to validate PR titles#32458
AgentEnder merged 1 commit intomasterfrom
feat/pr-title-validation

Conversation

@AgentEnder
Copy link
Copy Markdown
Member

Current Behavior

Currently, there is no automated check to ensure that PR titles follow our conventional commit format. This can lead to inconsistent PR titles that don't match our commit conventions.

Expected Behavior

With this change, all PR titles will be automatically validated against our git commit rules when a PR is:

  • Opened
  • Edited
  • Synchronized
  • Reopened

The check uses the existing scripts/commit-lint.js script to validate PR titles, ensuring they follow the same format as our commit messages (e.g., feat(scope): description, fix(scope): description, etc.).

Related Issue(s)

This was requested to improve PR quality and consistency across the repository.

Implementation Details

  • Added a new GitHub Actions workflow: .github/workflows/pr-title-validation.yml
  • The workflow writes the PR title and body to a temporary file in the format specified
  • Runs node ./scripts/commit-lint.js on the file to validate the PR title
  • The check will fail if the PR title doesn't match our conventional commit format
  • The workflow only runs for the nrwl repository owner (consistent with other workflows)

Test Plan

  • Tested locally with valid PR titles (e.g., feat(core): add new feature)
  • Tested locally with invalid PR titles (confirmed validation failure)
  • Tested with breaking change notation (fix(core)!: breaking change)
  • Test on actual PR once merged

🤖 Generated with Claude Code

Adds a new PR check that validates PR titles match our git commit rules
using the existing commit-lint.js script. The workflow runs on PR events
and ensures all PR titles follow the conventional commit format.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@AgentEnder AgentEnder requested a review from a team as a code owner August 21, 2025 19:59
@AgentEnder AgentEnder requested a review from Cammisuli August 21, 2025 19:59
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Aug 21, 2025 8:19pm

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Aug 21, 2025

View your CI Pipeline Execution ↗ for commit d994d90

Command Status Duration Result
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 36s View ↗
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded <1s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-21 20:28:49 UTC

@AgentEnder AgentEnder merged commit c916349 into master Aug 21, 2025
7 checks passed
@AgentEnder AgentEnder deleted the feat/pr-title-validation branch August 21, 2025 20:31
FrozenPandaz pushed a commit that referenced this pull request Aug 22, 2025
## Current Behavior

Currently, there is no automated check to ensure that PR titles follow
our conventional commit format. This can lead to inconsistent PR titles
that don't match our commit conventions.

## Expected Behavior

With this change, all PR titles will be automatically validated against
our git commit rules when a PR is:
- Opened
- Edited
- Synchronized
- Reopened

The check uses the existing `scripts/commit-lint.js` script to validate
PR titles, ensuring they follow the same format as our commit messages
(e.g., `feat(scope): description`, `fix(scope): description`, etc.).

## Related Issue(s)

This was requested to improve PR quality and consistency across the
repository.

## Implementation Details

- Added a new GitHub Actions workflow:
`.github/workflows/pr-title-validation.yml`
- The workflow writes the PR title and body to a temporary file in the
format specified
- Runs `node ./scripts/commit-lint.js` on the file to validate the PR
title
- The check will fail if the PR title doesn't match our conventional
commit format
- The workflow only runs for the `nrwl` repository owner (consistent
with other workflows)

## Test Plan

- [x] Tested locally with valid PR titles (e.g., `feat(core): add new
feature`)
- [x] Tested locally with invalid PR titles (confirmed validation
failure)
- [x] Tested with breaking change notation (`fix(core)!: breaking
change`)
- [ ] Test on actual PR once merged

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit c916349)
FrozenPandaz added a commit that referenced this pull request Aug 22, 2025
… (#32458)"

This reverts commit c916349.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This workflow may have a vulnerability.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We'll investigate it before re-introducing it.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants