unity-builder/src/model/input-readers/action-yaml.ts

13 lines
371 B
TypeScript
Raw Normal View History

2021-12-29 15:15:39 +00:00
import fs from 'fs';
import YAML from 'yaml';
export class ActionYamlReader {
private actionYamlParsed: any;
2021-12-29 15:53:44 +00:00
public constructor() {
2021-12-29 15:15:39 +00:00
this.actionYamlParsed = YAML.parse(fs.readFileSync(`action.yml`).toString());
}
public GetActionYamlValue(key: string) {
2021-12-29 18:15:23 +00:00
return this.actionYamlParsed.inputs[key]?.description || 'No description found in action.yml';
2021-12-29 15:15:39 +00:00
}
}