-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: implement subject pattern #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Bumps Node.js - Uses vitest over jest - Uses bare minimum eslint + prettier - Updates tsconfig - Updates UX
There was a problem hiding this 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 implements a subject pattern feature for conventional commit validation, allowing users to specify a regex pattern to validate the subject portion of pull request titles. The changes also modernize the codebase by migrating from Jest to Vitest, updating Node.js version, and switching to ES modules.
- Adds a new
subject_pattern
input parameter that accepts regex patterns for validating commit message subjects - Modernizes the build system with ES modules, updated dependencies (Vitest, ESLint, Rollup), and Node.js 22
- Replaces external
conventional-commit-types
dependency with local implementation and improves GitHub token handling
Reviewed Changes
Copilot reviewed 19 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/lint.ts | Implements subject pattern validation logic and updates import statements to ES modules |
src/lint.test.ts | New comprehensive test file using Vitest with subject pattern test coverage |
src/github.ts | Improves GitHub token handling with fallbacks and converts to ES module imports |
src/conventional-commit-types.ts | New local implementation of conventional commit types replacing external dependency |
package.json | Major dependency updates including Vitest, ESLint, and Node.js version bump to 22 |
action.yaml | Adds subject_pattern input and makes token optional with default value |
Comments suppressed due to low confidence (1)
src/lint.ts:34
- The variable name
matchedType
is misleading as it stores a regex pattern, not the actual type. Consider renaming it tomatchingRegex
orfoundMatch
.
const matchedType = matches.find((regex) => regex.test(title));
Co-authored-by: Copilot <[email protected]>
…its-pr-action into feat/subject-regex
Description
Testing
Updates some tests
New dependencies