Skip to content

Error logging the issue number #46

@lee-dohm

Description

@lee-dohm

I have some automation in a private repo that uses this Action, so thank you for building it!

Starting seven days ago, my automation is running into a problem where the issue is created but the Action throws an error after that. Relevant log details:

ℹ  info      Creating new issue Completely fake issue title
✖  error     An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/support-news-template.md!
✖  error     TypeError: (s || "").replace is not a function 
    at escapeData (/node_modules/@actions/core/lib/command.js:66:10)
    at Command.toString (/node_modules/@actions/core/lib/command.js:60:35)
    at Object.issueCommand (/node_modules/@actions/core/lib/command.js:23:30)
    at Object.setOutput (/node_modules/@actions/core/lib/core.js:88:15)
    at Toolkit.run (/index.js:49:10)
    at process._tickCallback (internal/process/next_tick.js:68:7)

It took me a while to figure out what was going wrong because I thought that the issue creation was throwing the error but still succeeding somehow? But inside the catch statement you're calling the actions-toolkit logging infrastructure and the stack trace only shows the actions/toolkit code. So it would appear that this line is hitting the error:

core.setOutput('number', issue.data.number)

because it is the first line after the issue is created that calls into core.whatever. I suspect that issue.data.number is no longer returning a Number in all cases?

Let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions