12
0
Fork 0
mirror of https://github.com/astral-sh/setup-uv.git synced 2026-06-30 01:30:44 +00:00

feat: add download-from-astral-mirror input

Add a new boolean input  (default: true)
that controls whether uv is downloaded from the Astral mirror or
directly from GitHub Releases. When set to false, the mirror rewrite
is skipped entirely.
This commit is contained in:
Kevin Stillhammer 2026-05-31 11:40:47 +02:00
parent ddb93f091f
commit 4fa8fca033
No known key found for this signature in database
10 changed files with 66 additions and 4 deletions

View file

@ -376,6 +376,32 @@ describe("download-version", () => {
"0.9.26",
);
});
it("skips the Astral mirror when downloadFromAstralMirror is false", async () => {
mockGetArtifact.mockResolvedValue({
archiveFormat: "tar.gz",
checksum: "abc123",
downloadUrl:
"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz",
});
await downloadVersion(
"unknown-linux-gnu",
"x86_64",
"0.9.26",
undefined,
"token",
undefined,
false,
);
expect(mockDownloadTool).toHaveBeenCalledWith(
"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz",
undefined,
"token",
);
expect(mockDownloadTool).toHaveBeenCalledTimes(1);
});
});
describe("rewriteToMirror", () => {