action yaml file as object

pull/310/head
Frostebite 2021-12-29 15:53:44 +00:00
parent 453f9fc6c4
commit 0070f3b6a2
4 changed files with 6 additions and 7 deletions

4
dist/index.js vendored
View File

@ -413,8 +413,9 @@ class CLI {
const properties = Object.getOwnPropertyNames(__1.Input);
core.info(`\n`);
core.info(`INPUT:`);
const actionYamlReader = new action_yaml_1.ActionYamlReader();
for (const element of properties) {
program.option(`--${element} <${element}>`, action_yaml_1.ActionYamlReader.Instance.GetActionYamlValue(element));
program.option(`--${element} <${element}>`, actionYamlReader.GetActionYamlValue(element));
if (__1.Input[element] !== undefined && __1.Input[element] !== '') {
core.info(`${element} ${__1.Input[element]}`);
}
@ -3446,7 +3447,6 @@ const fs_1 = __importDefault(__webpack_require__(35747));
const yaml_1 = __importDefault(__webpack_require__(13552));
class ActionYamlReader {
constructor() {
ActionYamlReader.Instance = this;
this.actionYamlParsed = yaml_1.default.parse(fs_1.default.readFileSync(`action.yml`).toString());
}
GetActionYamlValue(key) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -34,8 +34,9 @@ export class CLI {
const properties = Object.getOwnPropertyNames(Input);
core.info(`\n`);
core.info(`INPUT:`);
const actionYamlReader: ActionYamlReader = new ActionYamlReader();
for (const element of properties) {
program.option(`--${element} <${element}>`, ActionYamlReader.Instance.GetActionYamlValue(element));
program.option(`--${element} <${element}>`, actionYamlReader.GetActionYamlValue(element));
if (Input[element] !== undefined && Input[element] !== '') {
core.info(`${element} ${Input[element]}`);
}

View File

@ -2,10 +2,8 @@ import fs from 'fs';
import YAML from 'yaml';
export class ActionYamlReader {
public static Instance: ActionYamlReader;
private actionYamlParsed: any;
constructor() {
ActionYamlReader.Instance = this;
public constructor() {
this.actionYamlParsed = YAML.parse(fs.readFileSync(`action.yml`).toString());
}
public GetActionYamlValue(key: string) {