Skip to content

Commit ad5d4ad

Browse files
committed
Upgrade packages
1 parent c7a14aa commit ad5d4ad

File tree

4 files changed

+272
-1858
lines changed

4 files changed

+272
-1858
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ outputs:
2222
path:
2323
description: The directory where Crystal was installed
2424
runs:
25-
using: node16
25+
using: node20
2626
main: index.js
2727
branding:
2828
icon: octagon

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ async function downloadCrystalRelease(filePattern, version = null) {
346346
const resp = await github.request({
347347
url: asset["url"],
348348
headers: {"accept": "application/octet-stream"},
349-
request: {redirect: "manual"},
349+
request: {fetch: fetchWithManualRedirect},
350350
});
351351
const url = resp.headers["location"];
352352

@@ -375,7 +375,7 @@ async function downloadSource({name, repo, ref}) {
375375

376376
const resp = await github.rest.repos.downloadZipballArchive({
377377
...repo, ref,
378-
request: {redirect: "manual"},
378+
request: {fetch: fetchWithManualRedirect},
379379
});
380380
const url = resp.headers["location"];
381381
const downloadedPath = await ToolCache.downloadTool(url);
@@ -463,7 +463,7 @@ async function downloadCrystalNightlyForWindows(branch) {
463463
Core.info("Downloading Crystal build");
464464
const resp = await github.rest.actions.downloadArtifact({
465465
...RepoCrystal, "artifact_id": artifact.id, "archive_format": "zip",
466-
request: {redirect: "manual"},
466+
request: {fetch: fetchWithManualRedirect},
467467
});
468468
const url = resp.headers["location"];
469469
const downloadedPath = await ToolCache.downloadTool(url);
@@ -474,6 +474,10 @@ async function downloadCrystalNightlyForWindows(branch) {
474474

475475
const github = new Octokit({auth: Core.getInput("token") || null});
476476

477+
function fetchWithManualRedirect(url, options) {
478+
return fetch(url, {...options, redirect: "manual"});
479+
}
480+
477481
async function* getItemsFromPages(pages) {
478482
for await (const page of github.paginate.iterator(pages)) {
479483
for (const item of page.data) {

0 commit comments

Comments
 (0)