Skip to content

fix: update commit message validation pattern for improved accuracy#2

Merged
srajasimman merged 4 commits intomainfrom
commit-message-pattern-update
Sep 19, 2025
Merged

fix: update commit message validation pattern for improved accuracy#2
srajasimman merged 4 commits intomainfrom
commit-message-pattern-update

Conversation

@srajasimman
Copy link
Owner

This pull request updates the default commit message validation pattern in the commit-message-validator.js script to enforce a more precise and conventional commit message format.

Commit message validation:

  • Updated the default regular expression pattern used for commit message validation to be stricter and better aligned with conventional commit standards, improving consistency and clarity in commit messages.

@srajasimman srajasimman requested a review from Copilot September 19, 2025 06:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves commit message validation by replacing the existing regex pattern with a more precise and comprehensive one that better enforces conventional commit standards.

  • Updated the default regex pattern to be more specific about merge commit formats and conventional commit types
  • Enhanced pattern specificity for scope validation and PR creation messages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@srajasimman srajasimman requested a review from Copilot September 19, 2025 06:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@srajasimman srajasimman requested a review from Copilot September 19, 2025 06:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const token = core.getInput('github-token', { required: true });
const pattern = core.getInput('pattern') || '^((Merge[ a-z-]* branch.*)|(Revert*)|((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?!?: .*))$';

const mergeBranchPattern = "Merge branch '[^']+' into [^\\s]+";
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The merge branch pattern uses single quotes around the branch name but doesn't account for Git's default merge messages which use double quotes. Consider using \"Merge branch '[^']+' into [^\\s]+\" or make it more flexible to handle both quote styles.

Suggested change
const mergeBranchPattern = "Merge branch '[^']+' into [^\\s]+";
const mergeBranchPattern = 'Merge branch [\'"][^\'"]+[\'"] into [^\\s]+';

Copilot uses AI. Check for mistakes.
@srajasimman srajasimman requested a review from Copilot September 19, 2025 06:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@srajasimman srajasimman merged commit 4343ca0 into main Sep 19, 2025
1 of 2 checks passed
@srajasimman srajasimman deleted the commit-message-pattern-update branch September 25, 2025 15:06
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.

1 participant