action-setup/src/index.ts
2020-05-09 20:57:00 +07:00

28 lines
641 B
TypeScript

import { setFailed, getState } from '@actions/core'
import getInputs from './inputs'
import setOutputs from './outputs'
import installPnpm from './install-pnpm'
import pnpmInstall from './pnpm-install'
async function main() {
const isPost = getState('isPost')
console.log({
is_post: getState('is_post'),
isPost: getState('isPost'),
STATE_isPost: process.env['STATE_isPost'],
})
if (isPost) {
return
}
const inputs = getInputs()
await installPnpm(inputs)
console.log('Installation Completed!')
setOutputs(inputs)
pnpmInstall(inputs)
}
main().catch(error => {
console.error(error)
setFailed(error)
})