Skip to content

Commit

Permalink
Upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Oct 14, 2023
1 parent c7a14aa commit ad5d4ad
Show file tree
Hide file tree
Showing 4 changed files with 272 additions and 1,858 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ outputs:
path:
description: The directory where Crystal was installed
runs:
using: node16
using: node20
main: index.js
branding:
icon: octagon
Expand Down
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ async function downloadCrystalRelease(filePattern, version = null) {
const resp = await github.request({
url: asset["url"],
headers: {"accept": "application/octet-stream"},
request: {redirect: "manual"},
request: {fetch: fetchWithManualRedirect},
});
const url = resp.headers["location"];

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

const resp = await github.rest.repos.downloadZipballArchive({
...repo, ref,
request: {redirect: "manual"},
request: {fetch: fetchWithManualRedirect},
});
const url = resp.headers["location"];
const downloadedPath = await ToolCache.downloadTool(url);
Expand Down Expand Up @@ -463,7 +463,7 @@ async function downloadCrystalNightlyForWindows(branch) {
Core.info("Downloading Crystal build");
const resp = await github.rest.actions.downloadArtifact({
...RepoCrystal, "artifact_id": artifact.id, "archive_format": "zip",
request: {redirect: "manual"},
request: {fetch: fetchWithManualRedirect},
});
const url = resp.headers["location"];
const downloadedPath = await ToolCache.downloadTool(url);
Expand All @@ -474,6 +474,10 @@ async function downloadCrystalNightlyForWindows(branch) {

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

function fetchWithManualRedirect(url, options) {
return fetch(url, {...options, redirect: "manual"});
}

async function* getItemsFromPages(pages) {
for await (const page of github.paginate.iterator(pages)) {
for (const item of page.data) {
Expand Down

0 comments on commit ad5d4ad

Please sign in to comment.