Skip to content

Commit

Permalink
allow specifiying custom image url
Browse files Browse the repository at this point in the history
Signed-off-by: Aisha Tammy <floss@bsd.ac>
  • Loading branch information
epsilon-0 committed Sep 19, 2022
1 parent e21315a commit 56a0324
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/action/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,14 @@ export class Action {
}

async downloadDiskImage(): Promise<string> {
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}`)

Expand Down
8 changes: 8 additions & 0 deletions src/action/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
Expand Down

0 comments on commit 56a0324

Please sign in to comment.