-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TypeError: (s || "").replace is not a function #398
Comments
For reference, this is the method that's failing: https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L76 |
Here is the last working run (cutenode/action-meeting@f88068b): Here is the run that includes the change (cutenode/action-meeting@14879a2 or cutenode/action-meeting@71fa544) that triggered this: |
As of right now, objects have to be stringified when using try {
// ...
} catch (err) {
core.setFailed(err.toString());
} There's an on-going feature request to support objects out of the box as well. |
Thanks for that, it solved my problem. There is zero reason that should be limited to a string, and as far as I can tell it's not documented anywhere other than the code itself. FWIW, here's a helper function for anyone that encounters this and is lazy:
Just require this in and use it in your |
Doesn't
According to the docs, it's supposed to do so. |
May have been me overcompensating for the errors I was having. I encountered several cases in trying to debug this for 5 hours where the action successfully passed but the code errored out since unhandled promise rejections were not fully erroring the process. Updated. |
* Add debug for owner, repo Signed-off-by: Zack Koppert <zkoppert@github.com> * add dist Signed-off-by: Zack Koppert <zkoppert@github.com> * maybe this actions/toolkit#398 * Updating actions core * test Co-authored-by: Zack Koppert <zkoppert@github.com>
Describe the bug
When trying to run an action, I am getting the following error from
@actions/core
:To Reproduce
Last commit where it works:
It stops working in this commit:
EDIT: Updated to only reflect the commit it stopped working in. This was triggered by passing an incorrect type to Octokit.js for the
labels
property - I was passing a string and it required an array. Since the project was erroring because of that and the error being passed was not a string, I was encountering this issue.Expected behavior
For
@actions/core
to handle errors more effectively.The text was updated successfully, but these errors were encountered: