Skip to content

Commit

Permalink
Merge pull request #171 from anc95/chao
Browse files Browse the repository at this point in the history
* fix: matching

* fix: glob match

* rebuild

* only include src
  • Loading branch information
anc95 authored Dec 11, 2024
2 parents b7d3be9 + 238e108 commit cd4b113
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
LANGUAGE: English
OPENAI_API_ENDPOINT: https://api.bianxie.ai/v1
LOG_LEVEL: debug
INCLUDE_PATTERNS: 'src/**/*'
2 changes: 1 addition & 1 deletion action/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -150537,7 +150537,7 @@ exports.robot = robot;
const matchPatterns = (patterns, path) => {
return patterns.some((pattern) => {
try {
return (0, minimatch_1.minimatch)(path, pattern);
return (0, minimatch_1.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
Expand Down
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)
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 cd4b113

Please sign in to comment.