File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,10 @@ let private parseCommitMessage (commitMsg: string) =
63
63
Description = m.Groups.[ " description" ]. Value
64
64
BreakingChange = m.Groups.[ " breakingChange" ]. Success
65
65
}
66
+ |> Ok
66
67
67
68
else
68
- failwith
69
+ Error
69
70
$" Invalid commit message format.
70
71
71
72
Expected a commit message with the following format: <type>[optional scope]: <description>
@@ -151,13 +152,18 @@ type ReleaseCommand() =
151
152
152
153
let releaseCommits =
153
154
commits
154
- // Parse the commit to get the commit information
155
+ // Parse the commit to get the commit information (ignore invalid commits)
155
156
|> Seq.map ( fun commit ->
156
- {|
157
- Commit = commit
158
- CommitMessage = parseCommitMessage commit.MessageShort
159
- |}
157
+ match parseCommitMessage commit.MessageShort with
158
+ | Ok commitMessage ->
159
+ Some {|
160
+ Commit = commit
161
+ CommitMessage = commitMessage
162
+ |}
163
+ | Error _ -> None
160
164
)
165
+ |> Seq.filter Option.isSome
166
+ |> Seq.map Option.get
161
167
// Remove commits that don't trigger a release
162
168
|> Seq.filter ( fun commit ->
163
169
match commit.CommitMessage.Type with
@@ -345,6 +351,4 @@ type ReleaseCommand() =
345
351
346
352
Command.Run( " git" , " push" )
347
353
348
- // PublishCommand().Execute(context, PublishSettings(SkipBuild = true)) |> ignore
349
-
350
354
0
You can’t perform that action at this time.
0 commit comments