b04413352d
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 3.0.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md"><code>@actions/core</code>'s changelog</a>.</em></p> <blockquote> <h2>3.0.0</h2> <ul> <li><strong>Breaking change</strong>: Package is now ESM-only <ul> <li>CommonJS consumers must use dynamic <code>import()</code> instead of <code>require()</code></li> </ul> </li> </ul> <h2>2.0.3</h2> <ul> <li>Bump <code>@actions/http-client</code> to <code>3.0.2</code></li> </ul> <h2>2.0.1</h2> <ul> <li>Bump <code>@actions/exec</code> from 1.1.1 to 2.0.0 <a href="https://redirect.github.com/actions/toolkit/pull/2199">#2199</a></li> </ul> <h2>2.0.0</h2> <ul> <li>Add support for Node 24 <a href="https://redirect.github.com/actions/toolkit/pull/2110">#2110</a></li> <li>Bump <code>@actions/http-client</code> from 2.0.1 to 3.0.0</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/actions/toolkit/commits/HEAD/packages/core">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by [GitHub Actions](<a href="https://www.npmjs.com/~GitHub">https://www.npmjs.com/~GitHub</a> Actions), a new releaser for <code>@actions/core</code> since your current version.</p> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
import * as core from "@actions/core";
|
|
import { request } from "@octokit/request";
|
|
import { ProxyAgent, fetch as undiciFetch } from "undici";
|
|
|
|
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
|
|
|
|
// https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners
|
|
const proxyUrl =
|
|
process.env.https_proxy ||
|
|
process.env.HTTPS_PROXY ||
|
|
process.env.http_proxy ||
|
|
process.env.HTTP_PROXY;
|
|
|
|
/* c8 ignore start */
|
|
// Native support for proxies in Undici is under consideration: https://github.com/nodejs/undici/issues/1650
|
|
// Until then, we need to use a custom fetch function to add proxy support.
|
|
const proxyFetch = (url, options) => {
|
|
const urlHost = new URL(url).hostname;
|
|
const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").split(
|
|
",",
|
|
);
|
|
|
|
if (!noProxy.includes(urlHost)) {
|
|
options = {
|
|
...options,
|
|
dispatcher: new ProxyAgent(String(proxyUrl)),
|
|
};
|
|
}
|
|
|
|
return undiciFetch(url, options);
|
|
};
|
|
/* c8 ignore stop */
|
|
|
|
export default request.defaults({
|
|
headers: {
|
|
"user-agent": "actions/create-github-app-token",
|
|
},
|
|
baseUrl,
|
|
/* c8 ignore next */
|
|
request: proxyUrl ? { fetch: proxyFetch } : {},
|
|
});
|