Skip to content

Commit 5743464

Browse files
committed
fix: include patterns
1 parent 68ca958 commit 5743464

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

action/index.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150472,16 +150472,17 @@ const robot = (app) => {
150472150472
loglevel_1.default.debug('includePatterns:', includePatterns);
150473150473
changedFiles = changedFiles?.filter((file) => {
150474150474
const url = new URL(file.contents_url);
150475+
const pathname = decodeURIComponent(url.pathname);
150475150476
// if includePatterns is not empty, only include files that match the pattern
150476150477
if (includePatterns.length) {
150477-
return matchPatterns(includePatterns, url.pathname);
150478+
return matchPatterns(includePatterns, pathname);
150478150479
}
150479150480
if (ignoreList.includes(file.filename)) {
150480150481
return false;
150481150482
}
150482150483
// if ignorePatterns is not empty, ignore files that match the pattern
150483150484
if (ignorePatterns.length) {
150484-
return !matchPatterns(ignorePatterns, url.pathname);
150485+
return !matchPatterns(ignorePatterns, pathname);
150485150486
}
150486150487
return true;
150487150488
});

src/bot.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ export const robot = (app: Probot) => {
115115
changedFiles = changedFiles?.filter(
116116
(file) => {
117117
const url = new URL(file.contents_url)
118+
const pathname = decodeURIComponent(url.pathname)
118119
// if includePatterns is not empty, only include files that match the pattern
119120
if (includePatterns.length) {
120-
return matchPatterns(includePatterns, url.pathname)
121+
return matchPatterns(includePatterns, pathname)
121122
}
122123

123124
if (ignoreList.includes(file.filename)) {
@@ -126,7 +127,7 @@ export const robot = (app: Probot) => {
126127

127128
// if ignorePatterns is not empty, ignore files that match the pattern
128129
if (ignorePatterns.length) {
129-
return !matchPatterns(ignorePatterns, url.pathname)
130+
return !matchPatterns(ignorePatterns, pathname)
130131
}
131132

132133
return true

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { run } from "probot";
22
import log from "./log.js";
33
import { robot } from "./bot.js";
44

5-
log.info("Starting probot test");
5+
log.info("Starting probot");
66

77
run(robot)

0 commit comments

Comments
 (0)