Commit ddb971f 1 parent 08b96be commit ddb971f Copy full SHA for ddb971f
File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
11
11
"github.com/go-vela/cli/internal/output"
12
12
"github.com/go-vela/sdk-go/vela"
13
+ "github.com/go-vela/types/constants"
13
14
"github.com/go-vela/types/library"
14
15
15
16
"github.com/go-vela/server/compiler"
@@ -69,6 +70,10 @@ func (c *Config) Validate() error {
69
70
return fmt .Errorf ("invalid format for template file: %s (valid format: <name>:<source>)" , file )
70
71
}
71
72
}
73
+ case "exec" :
74
+ if strings .EqualFold (c .Event , constants .EventTag ) && len (c .Tag ) == 0 {
75
+ return fmt .Errorf ("no tag provided for tag event" )
76
+ }
72
77
}
73
78
74
79
return nil
Original file line number Diff line number Diff line change @@ -32,6 +32,25 @@ func TestPipeline_Config_Validate(t *testing.T) {
32
32
Output : "" ,
33
33
},
34
34
},
35
+ {
36
+ failure : true ,
37
+ config : & Config {
38
+ Action : "exec" ,
39
+ Org : "github" ,
40
+ Repo : "octocat" ,
41
+ Event : "tag" ,
42
+ },
43
+ },
44
+ {
45
+ failure : false ,
46
+ config : & Config {
47
+ Action : "exec" ,
48
+ Org : "github" ,
49
+ Repo : "octocat" ,
50
+ Event : "tag" ,
51
+ Tag : "v1.0.0" ,
52
+ },
53
+ },
35
54
{
36
55
failure : false ,
37
56
config : & Config {
You can’t perform that action at this time.
0 commit comments