Files
setup-pnpm/src/inputs/index.ts

25 lines
588 B
TypeScript
Raw Normal View History

2020-05-08 14:24:25 +07:00
import { getInput, InputOptions } from '@actions/core'
import expandTilde from 'expand-tilde'
2020-05-08 11:29:39 +07:00
export interface Inputs {
readonly version: string
readonly dest: string
readonly binDest: string
readonly registry: string
}
const options: InputOptions = {
required: true,
}
2020-05-08 14:24:25 +07:00
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
2020-05-08 14:12:16 +07:00
2020-05-08 14:24:25 +07:00
export const getInputs = (): Inputs => ({
2020-05-08 11:29:39 +07:00
version: getInput('version', options),
2020-05-08 14:24:25 +07:00
dest: parseInputPath('dest'),
binDest: parseInputPath('bin_dest'),
2020-05-08 11:29:39 +07:00
registry: getInput('registry', options),
})
export default getInputs