File tree Expand file tree Collapse file tree
src/main/updater/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ export class CheckForUpdateService {
2222
2323 const downloadsPath = app . getPath ( "downloads" ) ;
2424 const folderPath = path . join ( downloadsPath , folders . download ) ;
25-
25+ const token = process . env . GH_TOKEN ;
2626 const response = await fetch ( `${ restApi . urls . githubReleases } /latest` , {
2727 method : "GET" ,
2828 headers : {
29- Authorization : `Bearer ${ process . env . GH_TOKEN } ` ,
29+ ... ( token !== undefined ? { Authorization : `Bearer ${ token } ` } : { } ) ,
3030 Accept : "application/json" ,
3131 } ,
3232 } ) ;
Original file line number Diff line number Diff line change @@ -29,12 +29,15 @@ export class DownloadFileService {
2929 }
3030
3131 const filePath = path . join ( folderPath , name ) ;
32+ const token = process . env . GH_TOKEN ;
3233 const res = await fetch (
3334 `${ restApi . urls . githubReleases } /assets/${ assetId } ` ,
3435 {
3536 method : "GET" ,
3637 headers : {
37- Authorization : `Bearer ${ process . env . GH_TOKEN } ` ,
38+ ...( token !== undefined
39+ ? { Authorization : `Bearer ${ token } ` }
40+ : { } ) ,
3841 Accept : "application/octet-stream" ,
3942 } ,
4043 }
Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ export class SetFeedUrlService {
1111
1212 setFeedURL ( ) {
1313 if ( isPlatform ( "win32" ) && ! isDev ( ) ) {
14+ const token = process . env . GH_TOKEN ;
1415 autoUpdater . disableDifferentialDownload = true ;
1516 autoUpdater . setFeedURL ( {
1617 provider : "github" ,
1718 repo : publishOptions . repo ,
1819 owner : publishOptions . owner ,
1920 private : true ,
20- token : process . env . GH_TOKEN ,
21+ ...( token !== undefined
22+ ? {
23+ token : process . env . GH_TOKEN ,
24+ }
25+ : { } ) ,
2126 } ) ;
2227 }
2328 }
You can’t perform that action at this time.
0 commit comments