Author Filter
Filter rules based on PR author
The Author Filter allows you to apply rules only to PRs created by specific users. This is useful for creating different validation rules for different contributors, such as having stricter rules for external contributors or bypassing certain checks for bots.
Configuration
Must be set to "author"
Username patterns that should match (supports regex)
Username patterns that should not match (supports regex)
Basic Usage
Examples
Match Specific Users
Apply a rule only to PRs from specific users:
Exclude Bots
Skip a rule for PRs created by bots:
Team Members
Apply a rule only to PRs from team members (usernames starting with “team-”):
Pattern Matching
The Author Filter supports several pattern matching methods:
- Exact match:
"username1"
- Glob patterns:
"team-*"
- Regular expressions:
"/^team-.*$/"
(enclosed in forward slashes)
Practical Example
Different validation rules for team members vs. external contributors:
How It Works
The Author Filter retrieves the username of the PR author from the GitHub event context and checks if it matches the specified patterns. If match
is specified, the author must match at least one of the patterns for the rule to be applied. If ignore
is specified, the author must not match any of the patterns.
Best Practices
Be careful not to inadvertently exclude legitimate contributors through overly restrictive patterns