action yaml file as object
parent
453f9fc6c4
commit
0070f3b6a2
|
|
@ -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) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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]}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue