github-issue-parser icon indicating copy to clipboard operation
github-issue-parser copied to clipboard

fix(checkboxes): correctly parse checkboxes when the template is wrong or missing

Open jamacku opened this issue 1 year ago • 1 comments

When the wrong template is provided, then the action will traceback with the error:

/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:105
          result[key] = content.concat(value);
                                ^

TypeError: Cannot read properties of undefined (reading 'concat')
    at /home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:105:33
    at Array.forEach (<anonymous>)
    at toObject (/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:97:11)
    at run (/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:161:12)
    at 2932 (/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:184:3)
    at __nccwpck_require__ (/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:7097:43)
    at /home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:7117:37
    at Object.<anonymous> (/home/runner/work/_actions/stefanbuck/github-issue-parser/v3/dist/index.js:7120:12)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)

Also, checkboxes aren't represented as an array when the issue-form template is not provided.

This commit fixes both issues by correctly parsing checkboxes even when the template is wrong or missing.

Follow-up to:

  • https://github.com/stefanbuck/github-issue-parser/pull/21

Related to:

  • https://github.com/stefanbuck/github-issue-parser/issues/50

/cc @stefanbuck

jamacku avatar Apr 23 '24 13:04 jamacku

@joshjohanning, @gr2m, Could you please have a look? Thank you.

jamacku avatar Apr 25 '24 17:04 jamacku

:tada: This PR is included in version 3.1.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Apr 29 '24 17:04 github-actions[bot]

Thank you @gr2m 👍

jamacku avatar Apr 29 '24 17:04 jamacku

:tada: This PR is included in version 3.2.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 29 '24 18:05 github-actions[bot]