Skip to content

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

Merged
gr2m merged 1 commit into
stefanbuck:mainfrom
jamacku:checkboxes
Apr 29, 2024
Merged

gr2m merged 1 commit into
stefanbuck:mainfrom
jamacku:checkboxes

Conversation

@jamacku

@jamacku jamacku commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

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:

Related to:

/cc @stefanbuck

…g or missing

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

```js
/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.
@jamacku

jamacku commented Apr 25, 2024

Copy link
Copy Markdown
Contributor Author

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

@gr2m gr2m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏼 great PR

@gr2m
gr2m merged commit a87a2d9 into stefanbuck:main Apr 29, 2024
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@jamacku
jamacku deleted the checkboxes branch April 29, 2024 17:20
@jamacku

jamacku commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

Thank you @gr2m 👍

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants