(plugin) apps::jenkins - mode jobs fix --filter-job-name option (#4459)

This commit is contained in:
qgarnier 2023-06-09 14:31:17 +02:00 committed by GitHub
parent 002ffb42e4
commit c2e41b0923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -83,13 +83,13 @@ sub manage_selection {
$self->{jobs} = {};
foreach my $job (@{$jobs->{jobs}}) {
my $name = $job->{name};
next if (defined($self->{option_results}->{filter_job_name}) && $self->{option_results}->{filter_job_name} ne '' &&
$name !~ /$self->{option_results}->{filter_job_name}/);
if (defined($job->{healthReport}->[0]->{score})) {
$self->{jobs}->{$name} = { score => $job->{healthReport}->[0]->{score}, violations => 0 };
if ($job->{healthReport}->[0]->{description} =~ /^.+?([0-9]+)/ ) {
$self->{jobs}->{$name}->{violations} = $1;
if (!defined($self->{option_results}->{filter_job_name}) || $self->{option_results}->{filter_job_name} eq '' ||
$name =~ /$self->{option_results}->{filter_job_name}/) {
if (defined($job->{healthReport}->[0]->{score})) {
$self->{jobs}->{$name} = { score => $job->{healthReport}->[0]->{score}, violations => 0 };
if ($job->{healthReport}->[0]->{description} =~ /^.+?([0-9]+)/ ) {
$self->{jobs}->{$name}->{violations} = $1;
}
}
}