Skip to content

Commit

Permalink
read-yaml info blurbs for debugging (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Feb 24, 2022
1 parent 8972eb0 commit 9e13c60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion read-yaml/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ runs:
const path = "${{ inputs.path }}";
const data = await readYaml(path);
const scopes = yaml.load(`${{ inputs.scopes }}` || "{}");
const scopes = yaml.load(`${{ inputs.scopes }}`.trim() || "{}");
if (!Object.keys(scopes).length) {
core.info("loading \u001b[36;1mYAML\u001b[m as \u001b[36;1mscopes\u001b[m");
core.setOutput("scopes", data);
} else {
for (const scope in scopes) {
core.info(`loading \u001b[36;1m${scopes[scope]}\u001b[m as \u001b[36;1m${scope}\u001b[m ("${value.split(/\r?\n/)[0].slice(0, 10)}...")`);
let value = data;
try {
for (const key of scopes[scope].split('.'))
Expand Down

0 comments on commit 9e13c60

Please sign in to comment.