Lint/Rule/DeprecatedSetEnv.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 39 CC 3 SCAR 15.5
CC
3
Cov
0%
check_step
12.0
id
2.0
description
2.0
CRAP 4.7
1 package App::Workflow::Lint::Rule::DeprecatedSetEnv;
2  
3 use strict;
4 use warnings;
5 use Carp qw(croak carp);
6 use parent 'App::Workflow::Lint::Rule';
7  
8 sub id { 'deprecated-set-env' }
9 sub description { 'The ::set-env command is deprecated and insecure' }
10 sub applies_to { 'step' }
11 sub level { 'error' }
12  
13 sub check_step {
14 my ($self, $step, $ctx) = @_;
15  
16 return () unless exists $step->{run};
17  
18 my $run = $step->{run};
19  
20 return () unless $run =~ /::set-env/;
21  
22 return $self->diag(
23 message => "Deprecated ::set-env command used",
24 path => "/jobs/$ctx->{job_name}/steps/$ctx->{step_index}",
25 file => $ctx->{file},
26 );
27 }
28  
29 1;
30