Skip to content

Commit a7c34a2

Browse files
authored
Merge pull request #2032 from nodejs/SimenB-patch-1
chore: avoid extra request when checking for MUSL builds
2 parents 94fe46e + b0fe827 commit a7c34a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build-automation.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ const checkForMuslVersionsAndSecurityReleases = async (github, versions) => {
6262
const { data: unofficialBuildsIndexText } = await github.request('https://unofficial-builds.nodejs.org/download/release/index.json');
6363

6464
for (let version of Object.keys(versions)) {
65-
const { data: unofficialBuildsWebsiteText } = await github.request(`https://unofficial-builds.nodejs.org/download/release/v${versions[version].fullVersion}`);
65+
const buildVersion = unofficialBuildsIndexText.find(indexVersion => indexVersion.version === `v${versions[version].fullVersion}`);
6666

67-
versions[version].muslBuildExists = unofficialBuildsWebsiteText.includes("musl");
68-
versions[version].isSecurityRelease = unofficialBuildsIndexText.find(indexVersion => indexVersion.version === `v${versions[version].fullVersion}`)?.security;
67+
versions[version].muslBuildExists = buildVersion?.files.includes("linux-x64-musl") ?? false;
68+
versions[version].isSecurityRelease = buildVersion?.security ?? false;
6969
}
7070
return versions;
7171
} catch (error) {

0 commit comments

Comments
 (0)