@@ -84,14 +84,16 @@ module.exports = async ({ github, context, core }) => {
84
84
} ) ( ) ;
85
85
86
86
const is_author_only_contribution_on_GH = ( async ( ) => {
87
+ // WARNING: Depending on the time of day, event latency can be anywhere from 30s to 6h. (source: https://octokit.github.io/rest.js/v21/)
87
88
const { data : events } = await github . rest . activity . listEventsForAuthenticatedUser ( {
88
- username : author ,
89
- per_page : 1
89
+ username : author
90
+ // per_page: 1
90
91
} ) ;
91
92
92
93
console . log ( ">>> is_author_only_contribution_on_GH: " , {
93
94
username : author ,
94
- events_length : events . length === 0
95
+ events_length : events . length === 0 ,
96
+ events : events
95
97
} ) ;
96
98
97
99
return events . length === 0 ;
@@ -100,8 +102,8 @@ module.exports = async ({ github, context, core }) => {
100
102
console . log ( ">>> context.payload:" , context . payload )
101
103
102
104
const checks = [
103
- new Check ( ( ) => was_author_account_recently_created ( ) , "Account is less than an hour old" ) ,
104
- new Check ( ( ) => is_author_only_contribution_on_GH ( ) , "First contribution to any GitHub project" ) ,
105
+ new Check ( ( ) => was_author_account_recently_created , "Account is less than an hour old" ) ,
106
+ new Check ( ( ) => is_author_only_contribution_on_GH , "First contribution to any GitHub project" ) ,
105
107
new Check ( ( ) => user . followers === 0 && user . following === 0 , "Author has no relationships" ) ,
106
108
new Check ( ( ) => user . public_repos === 0 && user . public_gists === 0 , "Author has no public reop/gist" ) ,
107
109
] ;
0 commit comments