File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -38299,8 +38299,9 @@ const run = async () => {
3829938299 const createdIssues = []
3830038300
3830138301 // Iterate
38302+ let counter = 0
3830238303 for (const item of feed.items) {
38303- let title = `${issueTitlePrefix}${item.title}`
38304+ const title = `${issueTitlePrefix}${item.title}`
3830438305 if (titlePattern && !title.match(titlePattern)) {
3830538306 core.debug(`Feed item skipped because it does not match the title pattern (${title})`)
3830638307 continue
@@ -38342,11 +38343,19 @@ const run = async () => {
3834238343 // Create Issue
3834338344 createdIssues.push({ title, body, labels })
3834438345 } 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+ }
3834738351
38348- createdIssues[0].body += `\n\n${body}`
38352+ createdIssues[0].body += `\n\n# ${title}\n\n ${body}`
3834938353 }
38354+ counter++
38355+ }
38356+
38357+ if (aggregate && counter > 1) {
38358+ createdIssues[0].title = `${issueTitlePrefix}${counter} new items`
3835038359 }
3835138360
3835238361 for (const issue of createdIssues) {
Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ const run = async () => {
6262 const createdIssues = [ ]
6363
6464 // Iterate
65+ let counter = 0
6566 for ( const item of feed . items ) {
66- let title = `${ issueTitlePrefix } ${ item . title } `
67+ const title = `${ issueTitlePrefix } ${ item . title } `
6768 if ( titlePattern && ! title . match ( titlePattern ) ) {
6869 core . debug ( `Feed item skipped because it does not match the title pattern (${ title } )` )
6970 continue
@@ -105,11 +106,19 @@ const run = async () => {
105106 // Create Issue
106107 createdIssues . push ( { title, body, labels } )
107108 } 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+ }
110114
111- createdIssues [ 0 ] . body += `\n\n${ body } `
115+ createdIssues [ 0 ] . body += `\n\n# ${ title } \n\n ${ body } `
112116 }
117+ counter ++
118+ }
119+
120+ if ( aggregate && counter > 1 ) {
121+ createdIssues [ 0 ] . title = `${ issueTitlePrefix } ${ counter } new items`
113122 }
114123
115124 for ( const issue of createdIssues ) {
You can’t perform that action at this time.
0 commit comments