Skip to content

Commit 9a96cca

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 (or the publication date as fallback if the feed item lacks a title). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6c9f329 commit 9a96cca

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,16 @@ 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 && item.pubDate) item.title = new Date(item.pubDate).toUTCString()
85+
if (!item.title) {
86+
core.debug(`Feed item ${JSON.stringify(item)} skipped because it has no title`)
8787
continue
8888
}
89+
if (titlePattern && !item.title.match(titlePattern)) {
90+
core.debug(`Feed item skipped because it does not match the title pattern (${item.title})`)
91+
continue
92+
}
93+
const title = `${issueTitlePrefix}${item.title}`
8994

9095
core.debug(`Issue '${title}'`)
9196

0 commit comments

Comments
 (0)