Configuration
Must be set to
"title"
Regex pattern(s) that the title should match
Title length constraints
Minimum title length in characters
Maximum title length in characters
Custom message to display when validation fails
Basic Usage
Examples
Conventional Commits Format
Validate that PR titles follow the Conventional Commits format:Title Length Requirements
Ensure titles are neither too short nor too long:Multiple Patterns
Allow multiple title formats:Combined Requirements
Combine pattern matching and length requirements:Pattern Matching
The Title Validator uses JavaScript regular expressions for pattern matching. When specifying patterns, remember:- Patterns are case-sensitive by default
- Some characters need to be escaped with a backslash (
\
) - In YAML, backslashes need to be double escaped (
\\
)
i
flag: "/pattern/i"
How It Works
1
Retrieve PR Title
The validator retrieves the PR title from the GitHub event context
2
Check Pattern
If
match
is specified, it checks if the title matches any of the regex patterns3
Check Length
If
length
is specified, it verifies the title length is within the specified range4
Return Result
Returns a validation result with status (pass, fail, or error) and a message
Complete Rule Example
Best Practices
Use clear and consistent title patterns across your repositories
Provide helpful error messages explaining the expected format
Consider combining with the commit validator for consistency
Set reasonable length limits that allow for informative titles
Complex regex patterns may be difficult for contributors to understand; provide clear examples