@@ -7,7 +7,7 @@ defmodule Dwylbot.WebhooksController do
7
7
end
8
8
9
9
def create ( conn , params ) do
10
- IO . inspect params
10
+ # IO.inspect params
11
11
action = params [ "action" ]
12
12
labels = params [ "issue" ] [ "labels" ]
13
13
assignees = params [ "issue" ] [ "assignees" ]
@@ -16,13 +16,17 @@ defmodule Dwylbot.WebhooksController do
16
16
issue_id = params [ "issue" ] [ "number" ]
17
17
sender = params [ "sender" ] [ "login" ]
18
18
19
- invalid = action == "labeled" && contain_label? ( "in-progress" , labels ) && Enum . empty? ( assignees )
19
+ invalid = action == "labeled"
20
+ && contain_label? ( "in-progress" , labels ) && Enum . empty? ( assignees )
20
21
21
22
if invalid do
22
- client = Tentacat.Client . new ( % { access_token: System . get_env ( "GITHUB_ACCESS_TOKEN" ) } )
23
- comment_body = % { "body" => "@#{ sender } the `in-progress` label has been added to this issue **without an Assignee**.
24
- Please assign a user to this issue before applying the `in-progress` label." }
25
- Tentacat.Issues.Comments . create ( owner , repo , issue_id , comment_body , client )
23
+ client = Tentacat.Client . new ( % { access_token:
24
+ System . get_env ( "GITHUB_ACCESS_TOKEN" ) } )
25
+ comment_body = % { "body" => "@#{ sender } the `in-progress` label has been
26
+ added to this issue **without an Assignee**. Please assign a user to this
27
+ issue before applying the `in-progress` label." }
28
+ Tentacat.Issues.Comments . create ( owner , repo , issue_id ,
29
+ comment_body , client )
26
30
conn
27
31
|> put_status ( 201 )
28
32
|> json ( % { ok: true } )
0 commit comments