core.getInput returns an empty string if the value is not defined ^1. Splitting an empty string in JavaScript returns an array with an empty string, which is truthy. That means the checks for labels and reviewers are always true, even if the input is not defined.
> "".split("/")
[ '' ]
> Boolean([""])
true
In addition, add log output so that it's easier to figure out what's going on.
core.getInput
returns an empty string if the value is not defined ^1. Splitting an empty string in JavaScript returns an array with an empty string, which is truthy. That means the checks for labels and reviewers are always true, even if the input is not defined.In addition, add log output so that it's easier to figure out what's going on.