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

@actions/core 1.2.2 breaks when trying to set a number as output #321

Closed
dguo opened this issue Jan 23, 2020 · 3 comments
Closed

@actions/core 1.2.2 breaks when trying to set a number as output #321

dguo opened this issue Jan 23, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dguo
Copy link
Contributor

dguo commented Jan 23, 2020

Describe the bug

My team has code like:

core.setOutput("test_db_migrations", testDbMigrations ? 1 : 0);

This broke with the 1.2.2 release because it expects the output to be a string.

The error is: TypeError: (s || "").replace is not a function and occurs at node_modules/@actions/core/lib/command.js:66:10).

To Reproduce

Try to set a number as output.

Expected behavior

The library could do a .toString(), or I recommend at least updating the README to make it clear that the output value has to be a string.

Screenshots

N/A

Desktop (please complete the following information):

N/A

Smartphone (please complete the following information):

N/A

Additional context

N/A

@wpscholar
Copy link

What if I want to return an object?

@gr2m
Copy link
Collaborator

gr2m commented Feb 23, 2020

setOutput does not support objects. You can set it to a stringified object, but then have to parse it later

reiked added a commit to urbanmedia/sync-branches that referenced this issue Mar 17, 2020
satoryu added a commit to satoryu/typetalk-notify that referenced this issue Mar 29, 2020
TreTuna added a commit to TreTuna/sync-branches that referenced this issue Apr 7, 2020
Add pull request number, Add String cast to fix bug: actions/toolkit#321
@thboop thboop self-assigned this Apr 9, 2020
@thboop
Copy link
Collaborator

thboop commented Apr 13, 2020

Resolved in #405

@thboop thboop closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants