diff --git a/.github/workflows/release-fsharp.yml b/.github/workflows/release-fsharp.yml index 6e527dd..8f8b258 100644 --- a/.github/workflows/release-fsharp.yml +++ b/.github/workflows/release-fsharp.yml @@ -4,10 +4,10 @@ name: Release F# on: - workflow_dispatch: - # push: - # tags: - # - '*' + workflow_dispatch: # xxx + push: + tags: + - '*' permissions: contents: write diff --git a/src/Program.fs b/src/Program.fs index 059f831..f775ffa 100644 --- a/src/Program.fs +++ b/src/Program.fs @@ -38,6 +38,11 @@ type RETURN_CODE = | SUCCESS = 0 | FAIL = 1 +let truncate (valuesToTake: int) (args: string array) : string array = + match valuesToTake = -1 with + | true -> args + | false -> args |> Array.truncate valuesToTake + let getWorkflowNewPath () = Path.Combine [| Directory.GetCurrentDirectory(); "workflow.new.yml" |] @@ -65,11 +70,10 @@ let main (args: string array) : int = let! workflowKey = GitHubHelpers.getWorkflowKey () let tags = - match valuesToTake = -1 with - | true -> args - | false -> args |> Array.truncate valuesToTake + args |> Array.map (fun s -> s.Split(' ') |> Array.filter (String.IsNullOrEmpty >> not)) |> Array.concat // flat + |> truncate valuesToTake do! Validations.validateTagsAreNotEmpty tags