Skip to content

Commit f22987b

Browse files
committed
title-pattern: match _without_ prefix, if any
In the Git for Windows project, we tried to filter out cURL's release candidate versions via a title-pattern. However, we also specify a prefix and that pattern was applied _after_ prefixing the title. Not what we want. Really only match the original feed's title. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent aa3a20e commit f22987b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ const run = async () => {
8181
// Iterate
8282
let counter = 0
8383
for (const item of feed.items) {
84-
const title = `${issueTitlePrefix}${item.title || (item.pubDate && new Date(item.pubDate).toUTCString())}`
85-
if (titlePattern && !title.match(titlePattern)) {
86-
core.debug(`Feed item skipped because it does not match the title pattern (${title})`)
84+
if (!item.title && (titlePattern || !item.pubDate)) {
85+
core.debug(`Feed item ${JSON.stringify(item)} skipped because it has no title`)
8786
continue
8887
}
88+
if (titlePattern && !item.title.match(titlePattern)) {
89+
core.debug(`Feed item skipped because it does not match the title pattern (${item.title})`)
90+
continue
91+
}
92+
const title = `${issueTitlePrefix}${item.title || new Date(item.pubDate).toUTCString()}`
8993

9094
core.debug(`Issue '${title}'`)
9195

0 commit comments

Comments
 (0)