mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-08-08 02:07:02 +00:00
Add manifest-file input (#352)
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
export const REPO = "ruff";
|
||||
export const OWNER = "astral-sh";
|
||||
export const TOOL_CACHE_NAME = "ruff";
|
||||
export const VERSIONS_MANIFEST_URL =
|
||||
"https://raw.githubusercontent.com/astral-sh/versions/main/v1/ruff.ndjson";
|
||||
export const GITHUB_RELEASES_PREFIX =
|
||||
"https://github.com/astral-sh/ruff/releases/download/";
|
||||
export const ASTRAL_MIRROR_PREFIX =
|
||||
"https://releases.astral.sh/github/ruff/releases/download/";
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { ProxyAgent, type RequestInit, fetch as undiciFetch } from "undici";
|
||||
|
||||
export function getProxyAgent() {
|
||||
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
if (httpProxy) {
|
||||
return new ProxyAgent(httpProxy);
|
||||
}
|
||||
|
||||
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
if (httpsProxy) {
|
||||
return new ProxyAgent(httpsProxy);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export const fetch = async (url: string, opts: RequestInit) =>
|
||||
await undiciFetch(url, {
|
||||
dispatcher: getProxyAgent(),
|
||||
...opts,
|
||||
});
|
||||
@@ -6,3 +6,4 @@ export const githubToken = core.getInput("github-token");
|
||||
export const args = core.getInput("args");
|
||||
export const src = core.getInput("src");
|
||||
export const versionFile = core.getInput("version-file");
|
||||
export const manifestFile = core.getInput("manifest-file");
|
||||
|
||||
Reference in New Issue
Block a user