Skip to content

Commit cd4b113

Browse files
authored
Merge pull request #171 from anc95/chao
* fix: matching * fix: glob match * rebuild * only include src
2 parents b7d3be9 + 238e108 commit cd4b113

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.github/workflows/cr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ jobs:
1919
LANGUAGE: English
2020
OPENAI_API_ENDPOINT: https://api.bianxie.ai/v1
2121
LOG_LEVEL: debug
22+
INCLUDE_PATTERNS: 'src/**/*'

action/index.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150537,7 +150537,7 @@ exports.robot = robot;
150537150537
const matchPatterns = (patterns, path) => {
150538150538
return patterns.some((pattern) => {
150539150539
try {
150540-
return (0, minimatch_1.minimatch)(path, pattern);
150540+
return (0, minimatch_1.minimatch)(path, pattern.startsWith('/') ? "**" + pattern : pattern.startsWith("**") ? pattern : "**/" + pattern);
150541150541
}
150542150542
catch {
150543150543
// if the pattern is not a valid glob pattern, try to match it as a regular expression

src/bot.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const robot = (app: Probot) => {
195195
const matchPatterns = (patterns: string[], path: string) => {
196196
return patterns.some((pattern) => {
197197
try {
198-
return minimatch(path, pattern)
198+
return minimatch(path, pattern.startsWith('/') ? "**" + pattern : pattern.startsWith("**") ? pattern : "**/" + pattern);
199199
} catch {
200200
// if the pattern is not a valid glob pattern, try to match it as a regular expression
201201
try {

0 commit comments

Comments
 (0)