File tree 3 files changed +27
-9
lines changed
3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -38299,8 +38299,9 @@ const run = async () => {
38299
38299
const createdIssues = []
38300
38300
38301
38301
// Iterate
38302
+ let counter = 0
38302
38303
for (const item of feed.items) {
38303
- let title = `${issueTitlePrefix}${item.title}`
38304
+ const title = `${issueTitlePrefix}${item.title}`
38304
38305
if (titlePattern && !title.match(titlePattern)) {
38305
38306
core.debug(`Feed item skipped because it does not match the title pattern (${title})`)
38306
38307
continue
@@ -38342,11 +38343,19 @@ const run = async () => {
38342
38343
// Create Issue
38343
38344
createdIssues.push({ title, body, labels })
38344
38345
} else {
38345
- title = `${issueTitlePrefix}${new Date().toTimeString()}`
38346
- createdIssues[0].title = title
38346
+ if (counter === 1) {
38347
+ // The title of aggregated items will be "<n>new items";
38348
+ // Add the title to the body so that it does not go poof
38349
+ createdIssues[0].body = `# ${createdIssues[0].title}\n\n${createdIssues[0].body}`
38350
+ }
38347
38351
38348
- createdIssues[0].body += `\n\n${body}`
38352
+ createdIssues[0].body += `\n\n# ${title}\n\n ${body}`
38349
38353
}
38354
+ counter++
38355
+ }
38356
+
38357
+ if (aggregate && counter > 1) {
38358
+ createdIssues[0].title = `${issueTitlePrefix}${counter} new items`
38350
38359
}
38351
38360
38352
38361
for (const issue of createdIssues) {
Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ const run = async () => {
62
62
const createdIssues = [ ]
63
63
64
64
// Iterate
65
+ let counter = 0
65
66
for ( const item of feed . items ) {
66
- let title = `${ issueTitlePrefix } ${ item . title } `
67
+ const title = `${ issueTitlePrefix } ${ item . title } `
67
68
if ( titlePattern && ! title . match ( titlePattern ) ) {
68
69
core . debug ( `Feed item skipped because it does not match the title pattern (${ title } )` )
69
70
continue
@@ -105,11 +106,19 @@ const run = async () => {
105
106
// Create Issue
106
107
createdIssues . push ( { title, body, labels } )
107
108
} else {
108
- title = `${ issueTitlePrefix } ${ new Date ( ) . toTimeString ( ) } `
109
- createdIssues [ 0 ] . title = title
109
+ if ( counter === 1 ) {
110
+ // The title of aggregated items will be "<n>new items";
111
+ // Add the title to the body so that it does not go poof
112
+ createdIssues [ 0 ] . body = `# ${ createdIssues [ 0 ] . title } \n\n${ createdIssues [ 0 ] . body } `
113
+ }
110
114
111
- createdIssues [ 0 ] . body += `\n\n${ body } `
115
+ createdIssues [ 0 ] . body += `\n\n# ${ title } \n\n ${ body } `
112
116
}
117
+ counter ++
118
+ }
119
+
120
+ if ( aggregate && counter > 1 ) {
121
+ createdIssues [ 0 ] . title = `${ issueTitlePrefix } ${ counter } new items`
113
122
}
114
123
115
124
for ( const issue of createdIssues ) {
You can’t perform that action at this time.
0 commit comments