forked from medyagh/setup-minikube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputs.ts
33 lines (32 loc) · 1.1 KB
/
inputs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import {getInput} from '@actions/core'
export const setArgs = (args: string[]) => {
const inputs: {key: string; flag: string}[] = [
{key: 'addons', flag: '--addons'},
{key: 'cni', flag: '--cni'},
{key: 'container-runtime', flag: '--container-runtime'},
{key: 'cpus', flag: '--cpus'},
{key: 'driver', flag: '--driver'},
{key: 'extra-config', flag: '--extra-config'},
{key: 'feature-gates', flag: '--feature-gates'},
{key: 'insecure-registry', flag: '--insecure-registry'},
{key: 'kubernetes-version', flag: '--kubernetes-version'},
{key: 'listen-address', flag: '--listen-address'},
{key: 'memory', flag: '--memory'},
{key: 'mount-path', flag: '--mount-string'},
{key: 'network-plugin', flag: '--network-plugin'},
{key: 'wait', flag: '--wait'},
]
inputs.forEach((input) => {
const value = getInput(input.key)
if (value !== '') {
args.push(input.flag, value)
}
})
if (getInput('mount-path') !== '') {
args.push('--mount')
}
const startArgs = getInput('start-args')
if (startArgs !== '') {
args.push(...startArgs.split(' '))
}
}