close
Skip to content

TypeError: (s || "").replace is not a function #398

@bnb

Description

@bnb

Describe the bug
When trying to run an action, I am getting the following error from @actions/core:

(node:2588) UnhandledPromiseRejectionWarning: TypeError: (s || "").replace is not a function
    at escapeData (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/command.js:66:10)
    at Command.toString (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/command.js:60:35)
    at issueCommand (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/command.js:23:30)
    at Object.issue (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/command.js:27:5)
    at error (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/core.js:127:15)
    at Object.setFailed (/home/runner/work/_actions/cutenode/action-meeting/dev/node_modules/@actions/core/lib/core.js:101:5)
    at action (/home/runner/work/_actions/cutenode/action-meeting/dev/index.js:62:10)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2588) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions