Closed ljmf00 closed 11 months ago
CC @lolgab
@ljmf00: "==" is not POSIX compliant and also it won't make any difference in single brackets. Still to be usefull it should be inside [[ ]] instead of [ ]
@ljmf00: "==" is not POSIX compliant and also it won't make any difference in single brackets. Still to be usefull it should be inside [[ ]] instead of [ ]
The usage of non-POSIX complaint features is not a problem here, since the action uses the bash
shell, and that feature is specified in bash
. I can't also see that as an argument since the existing code uses bash-specific features after all.
As the commit message suggested, these changes were to improve consistency in one way or another and not about the usefulness of equality/pattern matching in bash
, as a feature. Arguing about the decision of making it consistent with ==
instead of =
is that it makes it more readable/less strange among other languages syntax.
68
What do you mean?
This patch adds double quotes on variables to prevent globbing and prevent evaluation errors such as:
It also add consistency on bash string equality comparison by using
==
operator instead of=
.Signed-off-by: Luís Ferreira contact@lsferreira.net
Since this is behaving "good" by accident, please double check if this doesn't break any specific use-case of this action. I recommend changing this to standalone scripts and passing GitHub variables by argument and parse them using something like POSIX getopt. See https://man7.org/linux/man-pages/man1/getopts.1p.html