File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
const PAT_TOKEN = process . env . PAT_TOKEN ;
2
2
const [ REPO_OWNER , REPO_NAME ] = process . env . GITHUB_REPOSITORY . split ( "/" ) ;
3
+ const today = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
3
4
4
5
async function getIssues ( ) {
5
6
const query =
@@ -85,10 +86,8 @@ async function addComment(issueNumber, comment) {
85
86
} ) ;
86
87
}
87
88
88
- function isTodayBetween ( start , end ) {
89
- if ( ! start || ! end ) return false ;
90
-
91
- const currentDate = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
89
+ function isDateBetween ( date , start , end ) {
90
+ const currentDate = new Date ( date ) ;
92
91
const startDate = new Date ( start ) ;
93
92
const endDate = new Date ( end ) ;
94
93
@@ -104,7 +103,7 @@ async function reminder() {
104
103
}
105
104
106
105
for ( const issue of issues ) {
107
- if ( ! isTodayBetween ( issue . start , issue . end ) ) {
106
+ if ( ! isDateBetween ( today , issue . start , issue . end ) ) {
108
107
console . log ( `No comments for issue #${ issue . number } : ${ issue . title } ` ) ;
109
108
continue ;
110
109
}
You can’t perform that action at this time.
0 commit comments