File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,27 @@ const main = async () => {
125125 const days = Math . max ( 1 , Math . min ( 30 , Number ( DAYS || 14 ) ) ) ;
126126 const fromDate = new Date ( Date . now ( ) - days * 24 * 60 * 60 * 1000 ) ;
127127
128+ // Debug: verify token type
129+ const tokenCheck = await fetch (
130+ 'https://api.github.com/users/liby/events?per_page=1' ,
131+ {
132+ headers : {
133+ authorization : `bearer ${ GH_TOKEN } ` ,
134+ accept : 'application/vnd.github.v3+json' ,
135+ } ,
136+ } ,
137+ ) ;
138+ console . log ( `Token scopes: ${ tokenCheck . headers . get ( 'x-oauth-scopes' ) } ` ) ;
139+ console . log (
140+ `Rate limit: ${ tokenCheck . headers . get ( 'x-ratelimit-limit' ) } ` ,
141+ ) ;
142+ const tokenCheckData = ( await tokenCheck . json ( ) ) as Array < {
143+ created_at : string ;
144+ } > ;
145+ if ( tokenCheckData . length > 0 ) {
146+ console . log ( `Latest event: ${ tokenCheckData [ 0 ] . created_at } ` ) ;
147+ }
148+
128149 console . log ( `Username: ${ username } ` ) ;
129150 console . log ( `Fetching data for the last ${ days } days` ) ;
130151
You can’t perform that action at this time.
0 commit comments