Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

19 changes: 16 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,23 @@ async function setupBuildx(version: string, toolkit: Toolkit): Promise<void> {
let toolPath: string | undefined;
const standalone = await toolkit.buildx.isStandalone();

// Check if requested version is already installed (e.g., pre-installed in VM rootfs)
if (version && (await toolkit.buildx.isAvailable())) {
try {
const { stdout } = await execAsync("buildx version");
const match = stdout.match(/v\d+\.\d+\.\d+/);
if (match && match[0] === version) {
core.info(`Buildx ${version} already installed, skipping download`);
await core.group(`Buildx version`, async () => {
await toolkit.buildx.printVersion();
});
return;
}
} catch {
// Version check failed, continue to download
}
}

if (!(await toolkit.buildx.isAvailable()) || version) {
await core.group(`Download buildx from GitHub Releases`, async () => {
toolPath = await retryWithBackoff(() =>
Expand Down