Fix js-yaml usage

This commit is contained in:
khai96_ 2021-03-23 11:43:49 +07:00
parent 2a105263a5
commit 3a2c7247e1
2 changed files with 3 additions and 4 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
import process from 'process'
import { safeLoad } from 'js-yaml'
import { load } from 'js-yaml'
import Ajv from 'ajv'
import { getInput, error, InputOptions } from '@actions/core'
import runInstallSchema from './run-install-input.schema.json'
@ -21,10 +21,9 @@ const options: InputOptions = {
}
export function parseRunInstall(name: string): RunInstall[] {
const result: RunInstallInput = safeLoad(getInput(name, options)) as any
const result: RunInstallInput = load(getInput(name, options)) as any
const ajv = new Ajv({
allErrors: true,
async: false,
})
const validate = ajv.compile(runInstallSchema)
if (!validate(result)) {