GeezerVison is showing github.com — tools: deps update authenticate github api request · nodejs/node@a60bc41
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-ada.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps" | 11 | 11 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 12 | 12 |
| 13 | 13 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 14 | | -const res = await fetch('https://api.github.com/repos/ada-url/ada/releases/latest'); | | 14 | +const res = await fetch('https://api.github.com/repos/ada-url/ada/releases/latest', | | 15 | + process.env.GITHUB_TOKEN && { | | 16 | + headers: { | | 17 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 18 | + }, | | 19 | + }); | 15 | 20 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 16 | 21 | const { tag_name } = await res.json(); | 17 | 22 | console.log(tag_name.replace('v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-base64.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps" | 12 | 12 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 13 | 13 |
| 14 | 14 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 15 | | -const res = await fetch('https://api.github.com/repos/aklomp/base64/releases/latest'); | | 15 | +const res = await fetch('https://api.github.com/repos/aklomp/base64/releases/latest', | | 16 | + process.env.GITHUB_TOKEN && { | | 17 | + headers: { | | 18 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 19 | + }, | | 20 | + }); | 16 | 21 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 17 | 22 | const { tag_name } = await res.json(); | 18 | 23 | console.log(tag_name.replace('v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-brotli.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps" | 12 | 12 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 13 | 13 |
| 14 | 14 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 15 | | -const res = await fetch('https://api.github.com/repos/google/brotli/releases/latest'); | | 15 | +const res = await fetch('https://api.github.com/repos/google/brotli/releases/latest', | | 16 | + process.env.GITHUB_TOKEN && { | | 17 | + headers: { | | 18 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 19 | + }, | | 20 | + }); | 16 | 21 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 17 | 22 | const { tag_name } = await res.json(); | 18 | 23 | console.log(tag_name.replace('v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-c-ares.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps" | 12 | 12 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 13 | 13 |
| 14 | 14 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 15 | | -const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/latest'); | | 15 | +const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/latest', | | 16 | + process.env.GITHUB_TOKEN && { | | 17 | + headers: { | | 18 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 19 | + }, | | 20 | + }); | 16 | 21 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 17 | 22 | const { tag_name } = await res.json(); | 18 | 23 | console.log(tag_name.replace('cares-', '').replaceAll('_', '.')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-cjs-module-lexer.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps" | 11 | 11 | NPM="$DEPS_DIR/npm/bin/npm-cli.js" | 12 | 12 |
| 13 | 13 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 14 | | -const res = await fetch('https://api.github.com/repos/nodejs/cjs-module-lexer/tags'); | | 14 | +const res = await fetch('https://api.github.com/repos/nodejs/cjs-module-lexer/tags', | | 15 | + process.env.GITHUB_TOKEN && { | | 16 | + headers: { | | 17 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 18 | + }, | | 19 | + }); | 15 | 20 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 16 | 21 | const tags = await res.json(); | 17 | 22 | const { name } = tags.at(0) | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-icu.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,12 @@ TOOLS_DIR="$BASE_DIR/tools" | 10 | 10 | [ -x "$NODE" ] || NODE=$(command -v node) | 11 | 11 |
| 12 | 12 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 13 | | -const res = await fetch('https://api.github.com/repos/unicode-org/icu/releases/latest'); | | 13 | +const res = await fetch('https://api.github.com/repos/unicode-org/icu/releases/latest', | | 14 | + process.env.GITHUB_TOKEN && { | | 15 | + headers: { | | 16 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 17 | + }, | | 18 | + }); | 14 | 19 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 15 | 20 | const { tag_name } = await res.json(); | 16 | 21 | console.log(tag_name.replace('release-', '').replace('-','.')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-libuv.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps" | 11 | 11 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 12 | 12 |
| 13 | 13 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 14 | | -const res = await fetch('https://api.github.com/repos/libuv/libuv/releases/latest'); | | 14 | +const res = await fetch('https://api.github.com/repos/libuv/libuv/releases/latest', | | 15 | + process.env.GITHUB_TOKEN && { | | 16 | + headers: { | | 17 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 18 | + }, | | 19 | + }); | 15 | 20 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 16 | 21 | const { tag_name } = await res.json(); | 17 | 22 | console.log(tag_name.replace('v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-llhttp.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,12 @@ DEPS_DIR="${BASE_DIR}/deps" | 13 | 13 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 14 | 14 |
| 15 | 15 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 16 | | -const res = await fetch('https://api.github.com/repos/nodejs/llhttp/releases/latest'); | | 16 | +const res = await fetch('https://api.github.com/repos/nodejs/llhttp/releases/latest', | | 17 | + process.env.GITHUB_TOKEN && { | | 18 | + headers: { | | 19 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 20 | + }, | | 21 | + }); | 17 | 22 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 18 | 23 | const { tag_name } = await res.json(); | 19 | 24 | console.log(tag_name.replace('release/v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-nghttp2.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,12 @@ DEPS_DIR="$BASE_DIR/deps" | 12 | 12 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 13 | 13 |
| 14 | 14 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 15 | | -const res = await fetch('https://api.github.com/repos/nghttp2/nghttp2/releases/latest'); | | 15 | +const res = await fetch('https://api.github.com/repos/nghttp2/nghttp2/releases/latest', | | 16 | + process.env.GITHUB_TOKEN && { | | 17 | + headers: { | | 18 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 19 | + }, | | 20 | + }); | 16 | 21 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 17 | 22 | const { tag_name } = await res.json(); | 18 | 23 | console.log(tag_name.replace('v', '')); | |
Collapse file Copy file name to clipboardExpand all lines: tools/dep_updaters/update-nghttp3.sh +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,12 @@ DEPS_DIR="$BASE_DIR/deps" | 11 | 11 | . "$BASE_DIR/tools/dep_updaters/utils.sh" | 12 | 12 |
| 13 | 13 | NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | 14 | | -const res = await fetch('https://api.github.com/repos/ngtcp2/nghttp3/releases'); | | 14 | +const res = await fetch('https://api.github.com/repos/ngtcp2/nghttp3/releases', | | 15 | + process.env.GITHUB_TOKEN && { | | 16 | + headers: { | | 17 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | | 18 | + }, | | 19 | + }); | 15 | 20 | if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | 16 | 21 | const releases = await res.json() | 17 | 22 | const { tag_name } = releases.at(0); | |
|