Skip to content

Commit

Permalink
fix: glob match
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 committed Dec 11, 2024
1 parent 75c8d14 commit a9c4098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const robot = (app: Probot) => {
const matchPatterns = (patterns: string[], path: string) => {
return patterns.some((pattern) => {
try {
return minimatch(path, pattern.startsWith('/') || pattern.startsWith('**') ? pattern : `**/${pattern}`);
return minimatch(path, pattern.startsWith('/') ? "**" + pattern : pattern.startsWith("**") ? pattern : "**/" + pattern);
} catch {
// if the pattern is not a valid glob pattern, try to match it as a regular expression
try {
Expand Down

0 comments on commit a9c4098

Please sign in to comment.