Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release-fsharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
name: Release F#

on:
workflow_dispatch:
# push:
# tags:
# - '*'
workflow_dispatch: # xxx
push:
tags:
- '*'

permissions:
contents: write
Expand Down
10 changes: 7 additions & 3 deletions src/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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" |]

Expand Down Expand Up @@ -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

Expand Down