lita-github-pinger 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92bae1dabb51a7962a1a784069d6f0ddbf2e0623
4
- data.tar.gz: f68b16342cfc7c267352bec07e57cd491c265422
3
+ metadata.gz: 6d3ecc0b40f14f05794f14b9523701362522db6e
4
+ data.tar.gz: 3bcd8723b6e69fd9abd4b0bf0ca566e26e1344a5
5
5
  SHA512:
6
- metadata.gz: 1ab6682af889f771d29d3df88ae9024f97ecf68e81c4ce63e756b13fc5902e37da0bea386d8c2dde5c73b39c66b83c26caf312eae392c6cb20f5f96ee7a8d7c6
7
- data.tar.gz: 8198e3c655ff70b6055745f6e89b296f7ec7b34874f571684edb8379172f281badecfc3b667e9bd864a200f58ee56f858aa9f288f300d36381cb26a6b25d670b
6
+ metadata.gz: 79a3cd94cdfe806deed670c48eb009cac59165d42ff31ecd9814e953c0fc14505d01e7d7d4aa40dd0a8c13cffa7e32d1fb47497848b0fadd487cac1072cc0934
7
+ data.tar.gz: 719098b48575a6a1310d4a9089d1d718a9b377df0cb991edb86984fcb7b0a83553b46f3fc29d7be65ffa422b3f8e5303ab13fd9011c1abe2f6d8db392173f9db
@@ -10,7 +10,28 @@ module Lita
10
10
 
11
11
  def ghping(request, response)
12
12
  body = MultiJson.load(request.body)
13
- send_dm("taylor", "```#{body}```")
13
+
14
+ if body["comment"]
15
+ pr_url = body["pull_request"]["html_url"]
16
+ pr_owner = body["pull_request"]["user"]["login"]
17
+ commenter = body["content"]["user"]["login"]
18
+ comment = body["comment"]["body"]
19
+
20
+ pr_owner = config.engineers.select do |eng|
21
+ eng[:github] == pr_owner
22
+ end.first[:slack]
23
+
24
+ commenter = config.engineers.select do |eng|
25
+ eng[:github] == commenter
26
+ end.first[:slack]
27
+
28
+ message = "(to #{pr_owner}) New PR comment from #{commenter}:\n"
29
+ message += "#{pr_url}\n> #{comment}"
30
+
31
+ send_dm("taylor", message)
32
+ end
33
+
34
+
14
35
  response
15
36
  end
16
37
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-github-pinger"
3
- spec.version = "0.3.1"
3
+ spec.version = "0.3.2"
4
4
  spec.authors = ["Taylor Lapeyre"]
5
5
  spec.email = ["taylorlapeyre@gmail.com"]
6
6
  spec.description = "A Lita handler that detects github comment notifications and regurgitates a ping to the correct slack username."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-github-pinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Lapeyre