gh-events 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58713f91216287189dcfaa4923c5d6ed5fc39793b53ea7501734bd987b25361a
4
- data.tar.gz: 00cb26e34a5001bc3299cb770111c188b68fc65d79d77a0b0b07938769f1e728
3
+ metadata.gz: 4aa33330e1cf347818446e7309be67a9a23c8111b830189d29047c017363cee5
4
+ data.tar.gz: d0928eed123ec7a5c5fd69122f6502f9158ada6bf3fce30af23c7026a1ac4fc4
5
5
  SHA512:
6
- metadata.gz: c66799eef1c74131c6ea21fa9c9ed5dd22ef1ce9f500ab0c275c75ee39f2171511dc7372a86e4e2d270bf74389efe61177d95af79283f8c14a970c09ee9067aa
7
- data.tar.gz: 1a4169ba66b98a0ed1cbbf6fa502c91f782358c18a247360c0e8f7c657cda8926bf63e05a584909d8041842feb8f32929b2d96252787967e8c31d24b371cc188
6
+ metadata.gz: 0bba3c1239377764f4cca8756a3fb2865f583a9b879722dcfb2f089c7f9c26ed8d9a46df9b69cf8cb52c5119f9cb9ad60e1f5add610a12bf9d3325bfd7fc4893
7
+ data.tar.gz: 4af3c4728fd84e62c89ee4fdd18bd683df65d8fd71d99657816f7da811b529c86746fc2bb60720bf3062b3a33cde7c718adadec323610b0dc88f15671b2203eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gh-events (0.4.4)
4
+ gh-events (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -36,7 +36,7 @@ module GH::Events::Slack
36
36
  end
37
37
 
38
38
  def render(template, data)
39
- ERB.new(template).result(ErbBinding.new(data).get_binding)
39
+ ERB.new(JSON.unparse(template)).result(ErbBinding.new(data).get_binding)
40
40
  end
41
41
 
42
42
  end
@@ -1,5 +1,5 @@
1
1
  module GH
2
2
  module Events
3
- VERSION = "0.4.4"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
data/res/slack.yml CHANGED
@@ -1,112 +1,162 @@
1
1
  # refs are unified. So all events have `ref` and `ref_type`.
2
2
 
3
- unknown: >-
4
- An unknown event occurred.
3
+ unknown:
4
+ text: >-
5
+ An unknown event occurred.
5
6
 
6
- push: >-
7
- :soon:
8
- <<%= sender.html_url %>|<%= sender.login %>>
9
- <%= forced ? 'force-' : '' %>pushed
10
- <% if ref_type == 'branch' %><%= num = size || commits.count %> commit<%= num > 1 ? 's' : '' %> to<% end %>
11
- <%= ref_type %> `<%= ref %>`
12
- on <<%= repository.html_url %>|<%= repository.full_name %>>
13
- (<<%= compare %>|compare>)
7
+ push:
8
+ text: >-
9
+ :arrow_up:
10
+ <<%= sender.html_url %>|<%= sender.login %>>
11
+ <%= forced ? 'force-' : '' %>pushed
12
+ <% if ref_type == 'branch' %><%= num = size || commits.count %> commit<%= num > 1 ? 's' : '' %> to<% end %>
13
+ <%= ref_type %> `<%= ref %>`
14
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
15
+ (<<%= compare %>|compare>)
14
16
 
15
- commit_comment: >-
16
- :left_speech_bubble:
17
- <<%= sender.html_url %>|<%= sender.login %>>
18
- commented
19
- commit <<%= comment.html_url %>|`<%= comment.commit_id %>`> on
20
- <<%= repository.html_url %>|<%= repository.full_name %>>: _<%= comment.body %>_
17
+ commit_comment:
18
+ text: >-
19
+ :left_speech_bubble:
20
+ new comment for
21
+ commit <<%= comment.html_url %>|`<%= comment.commit_id %>`>
22
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
23
+ attachments:
24
+ - fallback: <%= comment.body %>
25
+ color: '#36a64f'
26
+ # pretext: Optional text that appears above the attachment block
27
+ author_name: <%= sender.login %>
28
+ author_link: <%= sender.html_url %>
29
+ author_icon: <%= sender.avatar_url %>
30
+ # title: Slack API Documentation
31
+ # title_link: https://api.slack.com/
32
+ text: <%= comment.body %>
33
+ # fields:
34
+ # - title: Priority
35
+ # value: High
36
+ # short: false
37
+ # image_url: http://my-website.com/path/to/image.jpg
38
+ # thumb_url: http://example.com/path/to/thumb.png
39
+ # footer: Slack API
40
+ # footer_icon: https://platform.slack-edge.com/img/default_application_icon.png
41
+ # ts: 123456789
21
42
 
22
- create: >-
23
- :sparkles:
24
- <<%= sender.html_url %>|<%= sender.login %>>
25
- created
26
- <%= ref_type %> `<%= ref %>`
27
- on <<%= repository.html_url %>|<%= repository.full_name %>>
43
+ create:
44
+ text: >-
45
+ :sparkles:
46
+ <<%= sender.html_url %>|<%= sender.login %>>
47
+ created
48
+ <%= ref_type %> `<%= ref %>`
49
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
28
50
 
29
- delete: >-
30
- :collision:
31
- <<%= sender.html_url %>|<%= sender.login %>>
32
- deleted
33
- <%= ref_type %> `<%= ref %>`
34
- on <<%= repository.html_url %>|<%= repository.full_name %>>
51
+ delete:
52
+ text: >-
53
+ :collision:
54
+ <<%= sender.html_url %>|<%= sender.login %>>
55
+ deleted
56
+ <%= ref_type %> `<%= ref %>`
57
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
35
58
 
36
- issue_comment: >-
37
- :left_speech_bubble:
38
- <<%= sender.html_url %>|<%= sender.login %>>
39
- commented
40
- on <<%= comment.html_url %>|<%= issue.title %>>: _<%= comment.body %>_
59
+ issue_comment:
60
+ text: >-
61
+ :left_speech_bubble:
62
+ <<%= sender.html_url %>|<%= sender.login %>>
63
+ commented
64
+ on <<%= comment.html_url %>|<%= issue.title %>>: <%= comment.body %>
65
+ attachments:
66
+ - fallback: <%= comment.body %>
67
+ color: '#36a64f'
68
+ author_name: <%= sender.login %>
69
+ author_link: <%= sender.html_url %>
70
+ author_icon: <%= sender.avatar_url %>
71
+ text: <%= comment.body %>
41
72
 
42
- issues: >-
43
- :inbox_tray:
44
- <<%= sender.html_url %>|<%= sender.login %>>
45
- <%= action %>
46
- issue <<%= issue.html_url %>|<%= issue.title %>>
47
- on <<%= repository.html_url %>|<%= repository.full_name %>>
48
- <% if action == 'opened' %>\n| <%= issue.body %><% end %>
73
+ issues:
74
+ text: >-
75
+ :inbox_tray:
76
+ <<%= sender.html_url %>|<%= sender.login %>>
77
+ <%= action %>
78
+ issue <<%= issue.html_url %>|<%= issue.title %>>
79
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
80
+ <% if action == 'opened' %>: <%= issue.body %><% end %>
49
81
 
50
- issues.labeled: >-
51
- :label:
52
- <<%= sender.html_url %>|<%= sender.login %>>
53
- labeled
54
- issue <<%= issue.html_url %>|<%= issue.title %>>
55
- on <<%= repository.html_url %>|<%= repository.full_name %>>
56
- as `<%= label.name %>`
82
+ issues.labeled:
83
+ text: >-
84
+ :label:
85
+ <<%= sender.html_url %>|<%= sender.login %>>
86
+ labeled
87
+ issue <<%= issue.html_url %>|<%= issue.title %>>
88
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
89
+ as `<%= label.name %>`
57
90
 
58
- pull_request: >-
59
- :gift:
60
- <<%= sender.html_url %>|<%= sender.login %>>
61
- <%= action %>
62
- PR <<%= pull_request.html_url %>|<%= pull_request.title %>>
63
- on <<%= repository.html_url %>|<%= repository.full_name %>>
91
+ pull_request:
92
+ text: >-
93
+ :gift:
94
+ <<%= sender.html_url %>|<%= sender.login %>>
95
+ <%= action %>
96
+ PR <<%= pull_request.html_url %>|<%= pull_request.title %>>
97
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
64
98
 
65
- pull_request.labeled: >-
66
- <<%= sender.html_url %>|<%= sender.login %>>
67
- labeled
68
- PR <<%= pull_request.html_url %>|<%= pull_request.title %>>
69
- on <<%= repository.html_url %>|<%= repository.full_name %>>
70
- as `<%= label.name %>`
99
+ pull_request.labeled:
100
+ text: >-
101
+ <<%= sender.html_url %>|<%= sender.login %>>
102
+ labeled
103
+ PR <<%= pull_request.html_url %>|<%= pull_request.title %>>
104
+ on <<%= repository.html_url %>|<%= repository.full_name %>>
105
+ as `<%= label.name %>`
71
106
 
72
- pull_request_review_comment: >-
73
- :left_speech_bubble:
74
- <<%= sender.html_url %>|<%= sender.login %>>
75
- commented
76
- on <<%= comment.html_url %>|<%= .pull_request.title %>>: _<%= comment.body %>_
107
+ pull_request_review_comment:
108
+ text: >-
109
+ :left_speech_bubble:
110
+ <<%= sender.html_url %>|<%= sender.login %>>
111
+ commented
112
+ on <<%= comment.html_url %>|<%= .pull_request.title %>>: <%= comment.body %>
77
113
 
78
- star: >-
79
- :star:
80
- <<%= sender.html_url %>|<%= sender.login %>>
81
- <%= action == 'created' ? 'starred' : 'unstarred' %>
82
- <<%= repository.html_url %>|<%= repository.full_name %>>
83
- :star: <%= repository.stargazers_count %>
114
+ star:
115
+ text: >-
116
+ :star:
117
+ <<%= sender.html_url %>|<%= sender.login %>>
118
+ <%= action == 'created' ? 'starred' : 'unstarred' %>
119
+ <<%= repository.html_url %>|<%= repository.full_name %>>
120
+ :star: <%= repository.stargazers_count %>
84
121
 
85
- watch: >-
86
- :eye:
87
- <<%= sender.html_url %>|<%= sender.login %>>
88
- <%= action == 'created' ? 'started' : 'stopped' %> watching
89
- <<%= repository.html_url %>|<%= repository.full_name %>>
90
- :eye: <%= repository.watchers_count %>
122
+ watch:
123
+ text: >-
124
+ :eye:
125
+ <<%= sender.html_url %>|<%= sender.login %>>
126
+ <%= action == 'created' ? 'started' : 'stopped' %> watching
127
+ <<%= repository.html_url %>|<%= repository.full_name %>>
128
+ :eye: <%= repository.watchers_count %>
91
129
 
92
130
  # Ignore other status udpates than CircleCI failures for the moment
93
- status: >-
94
- <% if context.match(/circleci/) and state == 'failure' %>
95
- <<%= target_url %> | CircleCI build >
96
- fails for commit
97
- <<%= commit.html_url %> | <%= commit.commit.message %>>
98
- from
99
- <<%= sender.html_url %>|<%= sender.login %>>
100
- <% end %>
131
+ status:
132
+ text: >-
133
+ <% if context.match(/circleci/) and state == 'failure' %>
134
+ <<%= target_url %> | CircleCI build >
135
+ fails for commit
136
+ <<%= commit.html_url %> | <%= commit.commit.message %>>
137
+ from
138
+ <<%= sender.html_url %>|<%= sender.login %>>
139
+ <% end %>
101
140
 
102
- deployment: An event of type `deployment` occurred.
103
- deployment_status: An event of type `deployment_status` occurred.
104
- fork: An event of type `fork` occurred.
105
- gollum: An event of type `gollum` occurred.
106
- member: An event of type `member` occurred.
107
- membership: An event of type `membership` occurred.
108
- page_build: An event of type `page_build` occurred.
109
- public: An event of type `public` occurred.
110
- release: An event of type `release` occurred.
111
- repository: An event of type `repository` occurred.
112
- team_add: An event of type `team_add` occurred.
141
+ deployment:
142
+ text: An event of type `deployment` occurred.
143
+ deployment_status:
144
+ text: An event of type `deployment_status` occurred.
145
+ fork:
146
+ text: An event of type `fork` occurred.
147
+ gollum:
148
+ text: An event of type `gollum` occurred.
149
+ member:
150
+ text: An event of type `member` occurred.
151
+ membership:
152
+ text: An event of type `membership` occurred.
153
+ page_build:
154
+ text: An event of type `page_build` occurred.
155
+ public:
156
+ text: An event of type `public` occurred.
157
+ release:
158
+ text: An event of type `release` occurred.
159
+ repository:
160
+ text: An event of type `repository` occurred.
161
+ team_add:
162
+ text: An event of type `team_add` occurred.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh-events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Hofmann