feat: add download-from-astral-mirror input (#897)

## Summary

Add a new boolean input `download-from-astral-mirror` (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 and the
download goes straight to GitHub Releases.

Closes: #870
This commit is contained in:
Kevin Stillhammer
2026-05-31 11:47:01 +02:00
committed by GitHub
parent 80cc27528e
commit b9c8c4c7ba
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", () => {