Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Apr 29, 2024

Conversation

jamacku
Copy link
Contributor

@jamacku jamacku commented Apr 23, 2024

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
Copy link
Contributor Author

jamacku commented Apr 25, 2024

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

Copy link
Collaborator

@gr2m gr2m left a comment

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
1 check passed
Copy link

🎉 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
Copy link
Contributor Author

jamacku commented Apr 29, 2024

Thank you @gr2m 👍

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.

None yet

2 participants