fix: update commit message validation pattern for improved accuracy#2
fix: update commit message validation pattern for improved accuracy#2srajasimman merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
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.
…nd maintainability
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
commit-message-validator.js
Outdated
| 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]+"; |
There was a problem hiding this comment.
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.
| const mergeBranchPattern = "Merge branch '[^']+' into [^\\s]+"; | |
| const mergeBranchPattern = 'Merge branch [\'"][^\'"]+[\'"] into [^\\s]+'; |
There was a problem hiding this comment.
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.
This pull request updates the default commit message validation pattern in the
commit-message-validator.jsscript to enforce a more precise and conventional commit message format.Commit message validation: