File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,16 @@ export async function fetchGists() {
1111
1212 try {
1313 const gistsUrl = `https://api.github.com/users/${ username } /gists?per_page=${ state . perPage } ` ;
14- const dataStr = await downloadTextFile ( gistsUrl , null ) ;
14+ const dataStr = await downloadTextFile ( gistsUrl , null , { token : '' } ) ;
1515 const data : Gist [ ] = JSON . parse ( dataStr ) ;
1616
1717 for ( const gist of data ) {
1818 for ( const file of Object . values ( gist . files ) ) {
1919 if ( file . raw_url ) {
2020 try {
21- const content = await downloadTextFile ( file . raw_url , null ) ;
21+ const content = await downloadTextFile ( file . raw_url , null , {
22+ token : '' ,
23+ } ) ;
2224 file . content = content ;
2325 } catch ( e ) {
2426 err ( `Error fetching content for ${ file . filename } ` , e ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function downloadFile(
1717 const { accept, isBinary = false } = options ;
1818 let { token } = options ;
1919 const headers : Record < string , string > = { } ;
20- if ( ! token ) token = process . env . GITHUB_TOKEN ;
20+ if ( token === undefined ) token = process . env . GITHUB_TOKEN ;
2121 if ( token ) {
2222 headers . Authorization = `token ${ token } ` ;
2323 }
You can’t perform that action at this time.
0 commit comments