Homebrew / actions

🚀 Homebrew's GitHub Actions
BSD 2-Clause "Simplified" License
118 stars 39 forks source link

create-pull-request: fix empty string handling #587

Closed ZhongRuoyu closed 5 days ago

ZhongRuoyu commented 5 days ago

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.