mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-08-08 02:07:02 +00:00
Add option to skip Astral mirror downloads (#387)
## Summary - add `download-from-astral-mirror` input defaulting to `true` - skip mirror URL rewriting and download directly from GitHub Releases when disabled - document the input and add unit coverage Fixes #384 Refs: pi-session 019f31bc-bd1c-7276-9b4e-9734fa0aa367 ## Testing - npm run build - npm run check - npm run test:unit
This commit is contained in:
@@ -357,6 +357,32 @@ describe("download-version", () => {
|
||||
expect(mockDownloadTool).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("skips the Astral mirror when downloadFromAstralMirror is false", async () => {
|
||||
mockGetArtifact.mockResolvedValue({
|
||||
archiveFormat: "tar.gz",
|
||||
checksum: "abc123",
|
||||
downloadUrl:
|
||||
"https://github.com/astral-sh/ruff/releases/download/0.15.8/ruff-x86_64-unknown-linux-gnu.tar.gz",
|
||||
});
|
||||
|
||||
await downloadVersion(
|
||||
"unknown-linux-gnu",
|
||||
"x86_64",
|
||||
"0.15.8",
|
||||
undefined,
|
||||
"token",
|
||||
undefined,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockDownloadTool).toHaveBeenCalledWith(
|
||||
"https://github.com/astral-sh/ruff/releases/download/0.15.8/ruff-x86_64-unknown-linux-gnu.tar.gz",
|
||||
undefined,
|
||||
"token",
|
||||
);
|
||||
expect(mockDownloadTool).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("uses manifest-file checksum metadata when checksum input is unset", async () => {
|
||||
mockGetArtifact.mockResolvedValue({
|
||||
archiveFormat: "tar.gz",
|
||||
|
||||
Reference in New Issue
Block a user