Initial version of setup-ossutil

This commit is contained in:
Rimo
2020-01-15 16:36:04 +08:00
parent df25824a4d
commit e0feee7e7c
12 changed files with 4415 additions and 309 deletions

32
src/setup-ossutil.ts Normal file
View File

@@ -0,0 +1,32 @@
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as installer from './installer'
async function run(): Promise<void> {
try {
// download
const version = core.getInput('ossutil-version')
await installer.getOssutil(version)
// config
const endpoint = core.getInput('endpoint')
const accessKeyId = core.getInput('access-key-id')
const accessKeySecret = core.getInput('access-key-secret')
const stsToken = core.getInput('sts-token')
const args = [
'--endpoint',
endpoint,
'--access-key-id',
accessKeyId,
'--access-key-secret',
accessKeySecret,
'--sts-token',
stsToken
]
await exec.exec('ossutil', args)
} catch (error) {
core.setFailed(error.message)
}
}
run()