"prerelease: false" has been handled as true #4

Closed
opened 2024-04-18 02:56:10 +00:00 by wolfogre · 2 comments
Owner

It causes gitea/act#110

The point is

main.js Lines 18 to 19 in 89861ccfb7
const draft = Boolean(core.getInput("draft"))
const prerelease = Boolean(core.getInput("prerelease"))

However, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion

The empty string "" turns into false; other strings turn into true.

So Boolean("false") returns true.

image
It causes https://gitea.com/gitea/act/issues/110 The point is https://gitea.com/actions/gitea-release-action/src/commit/89861ccfb7d1b0e52ed87b5493c447de4f99e2f8/main.js#L18-L19 However, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion > The empty string "" turns into false; other strings turn into true. So `Boolean("false")` returns `true`. <img width="202" alt="image" src="/attachments/9a6c7787-1fc5-460f-97cf-79b10e9abd5e">
wolfogre added the
bug
label 2024-04-18 02:56:10 +00:00

Ahhhhhh, the familiar taste!
This reminds me of the Azure DevOps Pipeline task extensions.
Let's follow up on here.

Ahhhhhh, the familiar taste! This reminds me of the Azure DevOps Pipeline task extensions. Let's follow up on here.
Member
https://gitea.com/actions/gitea-release-action/commit/f119011bd6c95ab53d2084ace7b539694ce9b252
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: actions/gitea-release-action#4
No description provided.