File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ type RETURN_CODE =
38
38
| SUCCESS = 0
39
39
| FAIL = 1
40
40
41
+ let truncate ( valuesToTake : int ) ( args : string array ) : string array =
42
+ match valuesToTake = - 1 with
43
+ | true -> args
44
+ | false -> args |> Array.truncate valuesToTake
45
+
41
46
let getWorkflowNewPath () =
42
47
Path.Combine [| Directory.GetCurrentDirectory(); " workflow.new.yml" |]
43
48
@@ -65,11 +70,10 @@ let main (args: string array) : int =
65
70
let! workflowKey = GitHubHelpers.getWorkflowKey ()
66
71
67
72
let tags =
68
- match valuesToTake = - 1 with
69
- | true -> args
70
- | false -> args |> Array.truncate valuesToTake
73
+ args
71
74
|> Array.map ( fun s -> s.Split( ' ' ) |> Array.filter ( String.IsNullOrEmpty >> not ))
72
75
|> Array.concat // flat
76
+ |> truncate valuesToTake
73
77
74
78
do ! Validations.validateTagsAreNotEmpty tags
75
79
You can’t perform that action at this time.
0 commit comments