diff --git a/lib/dispatch/dispatch.ex b/lib/dispatch/dispatch.ex index d3e45c9..ed47b97 100644 --- a/lib/dispatch/dispatch.ex +++ b/lib/dispatch/dispatch.ex @@ -86,7 +86,7 @@ defmodule Dispatch do def extract_from_params(%{"pull_request" => %{"body" => body}} = params) do default_stacks = Map.get(params, "stacks", "") - ~r/#dispatch\/(\w+)/i + ~r/#dispatch\/([\w.]+)/i |> Regex.scan(body, capture: :all_but_first) |> (fn [] -> String.split(default_stacks, ",") diff --git a/test/dispatch_test.exs b/test/dispatch_test.exs index fd7bb50..e2e2c86 100644 --- a/test/dispatch_test.exs +++ b/test/dispatch_test.exs @@ -268,11 +268,11 @@ defmodule DispatchTest do Also, there are no default stacks in the webhook URL. - #dispatch/hcl #dispatch/Ruby + #dispatch/hcl #dispatch/Ruby #dispatch/node.js """ stacks = Dispatch.extract_from_params(%{"pull_request" => %{"body" => body}}) - assert stacks == ["hcl", "ruby"] + assert stacks == ["hcl", "ruby", "node.js"] end end