From 38122544edf56553c26c8cf3475f720ba9f2ecfc Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Wed, 13 May 2020 11:41:52 +0200 Subject: [PATCH] GitInput: only convert integer option values to int The previous code converted option values to ints when the value contained a digit somewhere. This is too eager since it also converts strings like `release-0.2` to an int which should not happen. We now only convert to int when the value is an integer. --- src/lib/Hydra/Plugin/GitInput.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Plugin/GitInput.pm b/src/lib/Hydra/Plugin/GitInput.pm index 5eaf7ae9..3fbf50f0 100644 --- a/src/lib/Hydra/Plugin/GitInput.pm +++ b/src/lib/Hydra/Plugin/GitInput.pm @@ -118,7 +118,7 @@ sub fetchInput { $name); # give preference to the options from the input value while (my ($opt_name, $opt_value) = each %{$options}) { - if ($opt_value =~ /\d+/) { + if ($opt_value =~ /^[+-]?\d+\z/) { $opt_value = int($opt_value); } $cfg->{$opt_name} = $opt_value;