tools: deps update authenticate github api request
PR-URL: https://github.com/nodejs/node/pull/48200 Fixes: https://github.com/nodejs/node/issues/48119 Refs: https://github.com/nodejs/security-wg/issues/973 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mestery <mestery@protonmail.com>
This commit is contained in:
parent
191dce8ff3
commit
40b89c51a8
@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/ada-url/ada/releases/latest');
|
const res = await fetch('https://api.github.com/repos/ada-url/ada/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/aklomp/base64/releases/latest');
|
const res = await fetch('https://api.github.com/repos/aklomp/base64/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/google/brotli/releases/latest');
|
const res = await fetch('https://api.github.com/repos/google/brotli/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/latest');
|
const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('cares-', '').replaceAll('_', '.'));
|
console.log(tag_name.replace('cares-', '').replaceAll('_', '.'));
|
||||||
|
@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
NPM="$DEPS_DIR/npm/bin/npm-cli.js"
|
NPM="$DEPS_DIR/npm/bin/npm-cli.js"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/nodejs/cjs-module-lexer/tags');
|
const res = await fetch('https://api.github.com/repos/nodejs/cjs-module-lexer/tags',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const tags = await res.json();
|
const tags = await res.json();
|
||||||
const { name } = tags.at(0)
|
const { name } = tags.at(0)
|
||||||
|
@ -10,7 +10,12 @@ TOOLS_DIR="$BASE_DIR/tools"
|
|||||||
[ -x "$NODE" ] || NODE=$(command -v node)
|
[ -x "$NODE" ] || NODE=$(command -v node)
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/unicode-org/icu/releases/latest');
|
const res = await fetch('https://api.github.com/repos/unicode-org/icu/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('release-', '').replace('-','.'));
|
console.log(tag_name.replace('release-', '').replace('-','.'));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/libuv/libuv/releases/latest');
|
const res = await fetch('https://api.github.com/repos/libuv/libuv/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -13,7 +13,12 @@ DEPS_DIR="${BASE_DIR}/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/nodejs/llhttp/releases/latest');
|
const res = await fetch('https://api.github.com/repos/nodejs/llhttp/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('release/v', ''));
|
console.log(tag_name.replace('release/v', ''));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/nghttp2/nghttp2/releases/latest');
|
const res = await fetch('https://api.github.com/repos/nghttp2/nghttp2/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/ngtcp2/nghttp3/releases');
|
const res = await fetch('https://api.github.com/repos/ngtcp2/nghttp3/releases',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const releases = await res.json()
|
const releases = await res.json()
|
||||||
const { tag_name } = releases.at(0);
|
const { tag_name } = releases.at(0);
|
||||||
|
@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/ngtcp2/ngtcp2/releases');
|
const res = await fetch('https://api.github.com/repos/ngtcp2/ngtcp2/releases',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const releases = await res.json()
|
const releases = await res.json()
|
||||||
const { tag_name } = releases.at(0);
|
const { tag_name } = releases.at(0);
|
||||||
|
@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/simdutf/simdutf/releases/latest');
|
const res = await fetch('https://api.github.com/repos/simdutf/simdutf/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps"
|
|||||||
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
. "$BASE_DIR/tools/dep_updaters/utils.sh"
|
||||||
|
|
||||||
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
|
||||||
const res = await fetch('https://api.github.com/repos/nodejs/uvwasi/releases/latest');
|
const res = await fetch('https://api.github.com/repos/nodejs/uvwasi/releases/latest',
|
||||||
|
process.env.GITHUB_TOKEN && {
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
|
||||||
const { tag_name } = await res.json();
|
const { tag_name } = await res.json();
|
||||||
console.log(tag_name.replace('v', ''));
|
console.log(tag_name.replace('v', ''));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user