Skip to content

Commit 2f61fad

Browse files
committed
feat: support https proxy
1 parent 5e01c01 commit 2f61fad

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

node_modules/.package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"type": "module",
88
"dependencies": {
99
"@actions/core": "^1.10.1",
10+
"@actions/http-client": "^2.2.3",
1011
"@actions/tool-cache": "^2.0.1",
1112
"semver": "^7.6.3",
1213
"undici": "^6.19.8"

src/version.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import semver from "semver";
22
import { fetch } from "undici";
33
import * as fs from "node:fs";
4+
import { HttpClient } from "@actions/http-client";
45

56
const GIT_HASH_RE = /^[0-9a-fA-F]{40}$/;
67

@@ -188,12 +189,17 @@ async function resolveRelease(range) {
188189

189190
/** @param {string} url */
190191
async function fetchWithRetries(url, maxRetries = 5) {
192+
const dispatcher = new HttpClient().getAgentDispatcher(url);
193+
191194
let sleepMs = 250;
192195
let iterationCount = 0;
193196
while (true) {
194197
iterationCount++;
195198
try {
196-
const res = await fetch(url);
199+
const res = await fetch(
200+
url,
201+
{ dispatcher: dispatcher },
202+
);
197203
if (res.status === 200 || iterationCount > maxRetries) {
198204
return res;
199205
}

0 commit comments

Comments
 (0)