2020-08-27 11:53:14 +08:00
|
|
|
import * as core from '@actions/core'
|
2020-08-27 20:39:35 +08:00
|
|
|
import {install} from './install'
|
2020-08-27 11:53:14 +08:00
|
|
|
|
|
|
|
|
async function run(): Promise<void> {
|
|
|
|
|
try {
|
2020-08-27 20:44:26 +08:00
|
|
|
const version: string = core.getInput('version', {
|
2022-12-25 13:58:23 +08:00
|
|
|
trimWhitespace: true
|
2020-08-27 20:39:35 +08:00
|
|
|
})
|
|
|
|
|
const commandPath = await install(version)
|
|
|
|
|
core.addPath(commandPath)
|
2020-08-27 11:53:14 +08:00
|
|
|
} catch (error) {
|
2021-08-29 14:37:54 +08:00
|
|
|
core.setFailed(error instanceof Error ? error.message : 'Unknown error')
|
2020-08-27 11:53:14 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run()
|