File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,22 @@ func (val Validate) validateSingleWorkflow(workflow ast.Workflow) error {
20
20
continue
21
21
}
22
22
23
- isApprovalJob := jobRef .Type == "approval"
24
- if isApprovalJob {
23
+ // Define valid job types
24
+ validJobTypesMap := map [string ]bool {
25
+ "approval" : true ,
26
+ "build" : true ,
27
+ "no-op" : true ,
28
+ "release" : true ,
29
+ }
30
+
31
+ // Direct lookup in the map
32
+ if validJobTypesMap [jobRef .Type ] {
25
33
continue
26
34
}
27
35
28
36
jobTypeIsDefined := jobRef .Type != ""
29
37
if jobTypeIsDefined {
30
- val .addDiagnostic (utils .CreateErrorDiagnosticFromRange (jobRef .TypeRange , " Type can only be \" approval \" " ))
38
+ val .addDiagnostic (utils .CreateErrorDiagnosticFromRange (jobRef .TypeRange , fmt . Sprintf ( "Job Type \" %s \" is not valid" , jobRef . Type ) ))
31
39
continue
32
40
}
33
41
You can’t perform that action at this time.
0 commit comments