@@ -62,7 +62,7 @@ module.exports = async ({ github, context, core }) => {
62
62
63
63
const { data : user } = await github . rest . users . getByUsername ( { username : author } ) ;
64
64
65
- const isAuthorOnlyContributionOnGH = async ( ) => {
65
+ const isAuthorOnlyContributionOnGH = await ( async ( ) => {
66
66
// WARNING: Depending on the time of day, event latency can be anywhere from 30s to 6h. (source: https://octokit.github.io/rest.js/v21/)
67
67
const { data : events } = await github . rest . activity . listEventsForAuthenticatedUser ( {
68
68
username : author ,
@@ -76,8 +76,8 @@ module.exports = async ({ github, context, core }) => {
76
76
} ) ;
77
77
78
78
return events . length === 0 ;
79
- } ;
80
- const WasAuthorRecentlyCreated = ( ) => {
79
+ } ) ( ) ;
80
+ const WasAuthorRecentlyCreated = ( ( ) => {
81
81
82
82
const time_point = ( ( ) => {
83
83
let value = new Date ( ) ;
@@ -92,7 +92,7 @@ module.exports = async ({ github, context, core }) => {
92
92
} ) ;
93
93
94
94
return create_at <= time_point ;
95
- }
95
+ } ) ( ) ;
96
96
97
97
const checks = [
98
98
new Check ( {
@@ -104,11 +104,11 @@ module.exports = async ({ github, context, core }) => {
104
104
reason : "Author has no public reop/gist"
105
105
} ) ,
106
106
new Check ( {
107
- predicate : WasAuthorRecentlyCreated ( ) ,
107
+ predicate : ( ) => WasAuthorRecentlyCreated ,
108
108
reason : "Account is less than an hour old"
109
109
} ) ,
110
110
new Check ( {
111
- predicate : await isAuthorOnlyContributionOnGH ( ) ,
111
+ predicate : ( ) => isAuthorOnlyContributionOnGH ,
112
112
reason : "First contribution to any GitHub project"
113
113
} ) ,
114
114
] ;
0 commit comments