From b0fe827a42423e3c2ae5777b0c7e864732e078e5 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 14 Feb 2024 13:21:52 +0100 Subject: [PATCH] chore: avoid extra request when checking for MUSL builds --- build-automation.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-automation.mjs b/build-automation.mjs index d29432638..9a085826b 100644 --- a/build-automation.mjs +++ b/build-automation.mjs @@ -62,10 +62,10 @@ const checkForMuslVersionsAndSecurityReleases = async (github, versions) => { const { data: unofficialBuildsIndexText } = await github.request('https://unofficial-builds.nodejs.org/download/release/index.json'); for (let version of Object.keys(versions)) { - const { data: unofficialBuildsWebsiteText } = await github.request(`https://unofficial-builds.nodejs.org/download/release/v${versions[version].fullVersion}`); + const buildVersion = unofficialBuildsIndexText.find(indexVersion => indexVersion.version === `v${versions[version].fullVersion}`); - versions[version].muslBuildExists = unofficialBuildsWebsiteText.includes("musl"); - versions[version].isSecurityRelease = unofficialBuildsIndexText.find(indexVersion => indexVersion.version === `v${versions[version].fullVersion}`)?.security; + versions[version].muslBuildExists = buildVersion?.files.includes("linux-x64-musl") ?? false; + versions[version].isSecurityRelease = buildVersion?.security ?? false; } return versions; } catch (error) {