diff --git a/src/action/action.ts b/src/action/action.ts index 801d090..a90a1ec 100644 --- a/src/action/action.ts +++ b/src/action/action.ts @@ -124,11 +124,14 @@ export class Action { } async downloadDiskImage(): Promise { + const image_url = this.operatingSystem.virtualMachineImageUrl + if this.input.image_url !== '' { + image_url = this.input.image_url + } core.info( - `Downloading disk image: ${this.operatingSystem.virtualMachineImageUrl}` + `Downloading disk image: ${image_url}` ) - const result = await cache.downloadTool( - this.operatingSystem.virtualMachineImageUrl + const result = await cache.downloadTool(image_url) ) core.info(`Downloaded file: ${result}`) diff --git a/src/action/input.ts b/src/action/input.ts index 589bd4e..7080296 100644 --- a/src/action/input.ts +++ b/src/action/input.ts @@ -7,6 +7,7 @@ export class Input { private run_?: string private operatingSystem_?: os.Kind private version_?: string + private image_url_?: string private shell_?: Shell private environmentVariables_?: string private architecture_?: architecture.Kind @@ -18,6 +19,13 @@ export class Input { })) } + get image_url(): string { + if (this.image_url_ !== undefined) return this.image_url_ + const input = core.getInput('image_url') + const image_url = input ? input : '' + return (this.image_url = image_url) + } + get operatingSystem(): os.Kind { if (this.operatingSystem_ !== undefined) return this.operatingSystem_ const input = core.getInput('operating_system', {required: true})