@@ -346,7 +346,7 @@ async function downloadCrystalRelease(filePattern, version = null) {
346
346
const resp = await github . request ( {
347
347
url : asset [ "url" ] ,
348
348
headers : { "accept" : "application/octet-stream" } ,
349
- request : { redirect : "manual" } ,
349
+ request : { fetch : fetchWithManualRedirect } ,
350
350
} ) ;
351
351
const url = resp . headers [ "location" ] ;
352
352
@@ -375,7 +375,7 @@ async function downloadSource({name, repo, ref}) {
375
375
376
376
const resp = await github . rest . repos . downloadZipballArchive ( {
377
377
...repo , ref,
378
- request : { redirect : "manual" } ,
378
+ request : { fetch : fetchWithManualRedirect } ,
379
379
} ) ;
380
380
const url = resp . headers [ "location" ] ;
381
381
const downloadedPath = await ToolCache . downloadTool ( url ) ;
@@ -463,7 +463,7 @@ async function downloadCrystalNightlyForWindows(branch) {
463
463
Core . info ( "Downloading Crystal build" ) ;
464
464
const resp = await github . rest . actions . downloadArtifact ( {
465
465
...RepoCrystal , "artifact_id" : artifact . id , "archive_format" : "zip" ,
466
- request : { redirect : "manual" } ,
466
+ request : { fetch : fetchWithManualRedirect } ,
467
467
} ) ;
468
468
const url = resp . headers [ "location" ] ;
469
469
const downloadedPath = await ToolCache . downloadTool ( url ) ;
@@ -474,6 +474,10 @@ async function downloadCrystalNightlyForWindows(branch) {
474
474
475
475
const github = new Octokit ( { auth : Core . getInput ( "token" ) || null } ) ;
476
476
477
+ function fetchWithManualRedirect ( url , options ) {
478
+ return fetch ( url , { ...options , redirect : "manual" } ) ;
479
+ }
480
+
477
481
async function * getItemsFromPages ( pages ) {
478
482
for await ( const page of github . paginate . iterator ( pages ) ) {
479
483
for ( const item of page . data ) {
0 commit comments