issue 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 88f61dcc894a75f1c8a140ed649a00415d5c1a53ef49df898b081afbfaa1c39f
4
- data.tar.gz: 37e140e2a0313766e4be4001b472adb57aaee8f834fcda63b7a687155bde0c87
3
+ metadata.gz: edf054d58775c3a56083086359673f70b4a67270233ac33959d0f1184b89e625
4
+ data.tar.gz: b5df077ef1860d4d030c9b23a3a847afd27307a2760200d67037c69c578fc069
5
5
  SHA512:
6
- metadata.gz: 13902a89b3863bc9d0a5b52e307737215644ee694ac05a6e1a1efb63dda0a5b41442783f729f09ab97da489da24bde28cad924293440ce116e7b89772f642610
7
- data.tar.gz: c0bd2d55ace130663a56041b833e9d430b223c450a13877d6cf8872976c051eaba9fca5d6d9ed90a7e05b6d7b95f66318535be3ce669fba637fe019a322308dd
6
+ metadata.gz: b527de4e23138ee77c2d8740c85df2370e6141d20642276f5a6d2a7d64901ce70a21b1058605d67a084eb110c5e395e75ea56c9ae9eb2e99337e2bcf87576142
7
+ data.tar.gz: e72e0322a81d36c612006d23fa1fa91aea3ae11f458b29c1ab83d166f6c17deb901fbc59e86ce534d765101b80b9fc10829524de7e93d623a4529218cec66ae2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2021-10-04)
4
+
5
+ - Add comment_id to Payload's context
6
+
7
+ ## 0.2.0 (2021-07-06)
8
+
9
+ - Added support for `pull_request` type events
10
+
3
11
  ## 0.1.0 (2021-07-01)
4
12
 
5
13
  - Added initial functionality and classes
@@ -10,4 +18,4 @@
10
18
 
11
19
  ## 0.0.1 (2021-06-29)
12
20
 
13
- - Gem created
21
+ - Gem created
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/issue.svg)](https://badge.fury.io/rb/issue)
3
3
  [![Tests](https://github.com/xuanxu/issue/actions/workflows/tests.yml/badge.svg)](https://github.com/xuanxu/issue/actions/workflows/tests.yml)
4
4
 
5
- Issue is a small library dedicated to parse requests coming from GitHub webhooks representing `issues`, `issue_comment` and `pull_request` events.
5
+ Issue is a small library dedicated to parse requests coming from GitHub webhooks triggered by `issues`, `issue_comment` and `pull_request` events.
6
6
 
7
7
  ## Getting started
8
8
 
data/lib/issue/payload.rb CHANGED
@@ -6,8 +6,9 @@ module Issue
6
6
  attr_accessor :context
7
7
 
8
8
  # Initialize Issue::Payload object with:
9
- # json_data: the json sent from a GitHub webhook
10
- # event: the value of the HTTP_X_GITHUB_EVENT header
9
+ #
10
+ # json_data: the parsed json sent from a GitHub webhook
11
+ # event: the value of the HTTP_X_GITHUB_EVENT header
11
12
  #
12
13
  # Initializing a new Issue::Payload instance makes all this info
13
14
  # from the json webhook available via accessor methods:
@@ -23,7 +24,7 @@ module Issue
23
24
  # event_action
24
25
  # raw_payload
25
26
  #
26
- # And if the case the event is 'issue_comment' also:
27
+ # And when the event is 'issue_comment' also:
27
28
  #
28
29
  # comment_body
29
30
  # comment_created_at
@@ -63,6 +64,7 @@ module Issue
63
64
  )
64
65
 
65
66
  if event == "issue_comment"
67
+ @context[:comment_id] = json_data.dig("comment", "id")
66
68
  @context[:comment_body] = json_data.dig("comment", "body")
67
69
  @context[:comment_created_at] = json_data.dig("comment", "created_at")
68
70
  @context[:comment_url] = json_data.dig("comment", "html_url")
data/lib/issue/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Issue
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/issue/webhook.rb CHANGED
@@ -15,10 +15,10 @@ module Issue
15
15
 
16
16
  # Initialize the Issue::Webhook object
17
17
  # This method should receive a Hash with the following settings:
18
- # * secret_token: the GitHub secret token needed to verify the request signature
19
- # * accept_events: an Array of valid values for the HTTP_X_GITHUB_EVENT header. If empty any event will be precessed.
20
- # * origin: the respository where the webhook should be sent to be accepted. If empty any request will be precessed.
21
- # * discard_sender: an optional GitHub user handle to discard all events triggered by it.
18
+ # secret_token: the GitHub secret token needed to verify the request signature.
19
+ # accept_events: an Array of valid values for the HTTP_X_GITHUB_EVENT header. If empty any event will be processed.
20
+ # origin: the respository where the webhook should be sent to be accepted. If empty any request will be processed.
21
+ # discard_sender: an optional GitHub user handle to discard all events triggered by it.
22
22
  def initialize(settings={})
23
23
  @secret_token = settings[:secret_token]
24
24
  @accept_origin = settings[:origin]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: issue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanjo Bazán
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openssl
@@ -86,7 +86,7 @@ licenses:
86
86
  - MIT
87
87
  metadata:
88
88
  bug_tracker_uri: https://github.com/xuanxu/issue/issues
89
- changelog_uri: https://github.com/xuanxu/issue/blob/master/CHANGELOG.md
89
+ changelog_uri: https://github.com/xuanxu/issue/blob/main/CHANGELOG.md
90
90
  documentation_uri: https://www.rubydoc.info/gems/issue
91
91
  homepage_uri: http://github.com/xuanxu/issue
92
92
  source_code_uri: http://github.com/xuanxu/issue
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.2.15
111
+ rubygems_version: 3.2.22
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Manage webhook payload for issue events