nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.13k stars 1.95k forks source link

chore: avoid extra request when checking for MUSL builds #2032

Closed SimenB closed 4 months ago

SimenB commented 4 months ago

Description

Avoid the extra network call per version as we have all the info needed from the index.json file.

Motivation and Context

See #2031

Testing Details

// tested in repl which has TLA
const { Octokit } = require('@octokit/rest');

const github = new Octokit();

const { data: unofficialBuildsIndexText } = await github.request('https://unofficial-builds.nodejs.org/download/release/index.json');

const buildVersion = unofficialBuildsIndexText.find(indexVersion => indexVersion.version === 'v20.0.0');

console.log(buildVersion?.files.includes('linux-x64-musl'));
console.log(buildVersion?.security);

Example Output(if appropriate)

Types of changes

Checklist

SimenB commented 4 months ago

(I'll land this after today's security release, just in case it messes something up)