@@ -444,7 +444,6 @@ function allIncluded(outputTarget = 'email') {
444
444
// Attach commits to PR objects
445
445
openPRs . forEach ( pr => {
446
446
pr . _allCommits = commitMap [ pr . number ] || [ ] ;
447
- pr . _lastCommits = pr . _allCommits ;
448
447
} ) ;
449
448
}
450
449
}
@@ -934,12 +933,27 @@ ${userReason}`;
934
933
}
935
934
936
935
if ( item . pull_request ) {
936
+
937
+ const prCreatedDate = new Date ( item . created_at ) ;
938
+ const startDate = new Date ( startingDate ) ;
939
+ const endDate = new Date ( endingDate + 'T23:59:59' ) ;
940
+ const isNewPR = prCreatedDate >= startDate && prCreatedDate <= endDate ;
941
+
942
+ if ( ! isNewPR ) {
943
+ const hasCommitsInRange = showCommits && item . _allCommits && item . _allCommits . length > 0 ;
944
+ if ( ! hasCommitsInRange ) {
945
+ continue ; //skip these prs - created outside daterange with no commits
946
+ }
947
+ }
948
+
949
+ const prAction = isNewPR ? 'Made PR' : 'Existing PR' ;
950
+
937
951
if ( isDraft ) {
938
- li = `<li><i>(${ project } )</i> - Made PR (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_draft_button } </li>` ;
952
+ li = `<li><i>(${ project } )</i> - ${ prAction } (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_draft_button } </li>` ;
939
953
} else if ( item . state === 'open' ) {
940
- li = `<li><i>(${ project } )</i> - Made PR (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_open_button } ` ;
941
- if ( showCommits && item . _lastCommits && item . _lastCommits . length ) {
942
- item . _lastCommits . forEach ( commit => {
954
+ li = `<li><i>(${ project } )</i> - ${ prAction } (#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ pr_open_button } ` ;
955
+ if ( showCommits && item . _allCommits && item . _allCommits . length ) {
956
+ item . _allCommits . forEach ( commit => {
943
957
li += `<li style="list-style: disc; margin: 0 0 0 20px; padding: 0; color: #666;"><span style="color:#2563eb;">${ commit . messageHeadline } </span><span style="color:#666; font-size: 11px;"> (${ new Date ( commit . committedDate ) . toLocaleString ( ) } )</span></li>` ;
944
958
} ) ;
945
959
}
@@ -960,7 +974,7 @@ ${userReason}`;
960
974
}
961
975
}
962
976
lastWeekArray . push ( li ) ;
963
- continue ; // Prevent issue logic from overwriting PR li
977
+ continue ;
964
978
} else {
965
979
// is a issue
966
980
if ( item . state === 'open' && item . body ?. toUpperCase ( ) . indexOf ( 'YES' ) > 0 ) {
0 commit comments