mirror of
https://github.com/pnpm/action-setup.git
synced 2025-09-11 03:41:34 +08:00
25 lines
588 B
TypeScript
25 lines
588 B
TypeScript
import { getInput, InputOptions } from '@actions/core'
|
|
import expandTilde from 'expand-tilde'
|
|
|
|
export interface Inputs {
|
|
readonly version: string
|
|
readonly dest: string
|
|
readonly binDest: string
|
|
readonly registry: string
|
|
}
|
|
|
|
const options: InputOptions = {
|
|
required: true,
|
|
}
|
|
|
|
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
|
|
|
|
export const getInputs = (): Inputs => ({
|
|
version: getInput('version', options),
|
|
dest: parseInputPath('dest'),
|
|
binDest: parseInputPath('bin_dest'),
|
|
registry: getInput('registry', options),
|
|
})
|
|
|
|
export default getInputs
|