octokit 7.1.0 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -21
- data/lib/octokit/client/apps.rb +25 -0
- data/lib/octokit/client/pull_requests.rb +5 -4
- data/lib/octokit/client/reactions.rb +49 -0
- data/lib/octokit/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9f2dca26c45a1b912572448c2fe16e78f37b7bb5fc7dc885488847c6eb19315
|
4
|
+
data.tar.gz: 11a332c8d3ad5f92ac0ed01ccd03e6a699f852d31946e6e4acc43e75ea3b2d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4790f888c01d7094b822ba72fc1ac576efa0803c6433982b53373787649b9b398842ee2986e43af6000677cda62a81e9072936b1d46c516a441a8256de10a1ae
|
7
|
+
data.tar.gz: 135c6ab374669d1db0fd18172670f79856adb627ef3e8cf015e0af93dacedf110f6f022df2be04907fdf11d4db68d7c382569e56f792d4c5eac2db7f65f8bbec
|
data/README.md
CHANGED
@@ -213,15 +213,7 @@ user.login
|
|
213
213
|
# => "defunkt"
|
214
214
|
```
|
215
215
|
|
216
|
-
You can [create access tokens through your GitHub Account Settings](https://help.github.com/articles/creating-an-access-token-for-command-line-use)
|
217
|
-
or with a basic authenticated Octokit client:
|
218
|
-
|
219
|
-
```ruby
|
220
|
-
client = Octokit::Client.new(:login => 'defunkt', :password => 'c0d3b4ssssss!')
|
221
|
-
|
222
|
-
client.create_authorization(:scopes => ["user"], :note => "Name of token")
|
223
|
-
# => <your new oauth token>
|
224
|
-
```
|
216
|
+
You can [create access tokens through your GitHub Account Settings](https://help.github.com/articles/creating-an-access-token-for-command-line-use).
|
225
217
|
|
226
218
|
### Two-Factor Authentication
|
227
219
|
|
@@ -237,18 +229,6 @@ client = Octokit::Client.new \
|
|
237
229
|
user = client.user("defunkt", :headers => { "X-GitHub-OTP" => "<your 2FA token>" })
|
238
230
|
```
|
239
231
|
|
240
|
-
As you can imagine, this gets annoying quickly since two-factor auth tokens are very short lived. So it is recommended to create an oauth token for the user to communicate with the API:
|
241
|
-
|
242
|
-
```ruby
|
243
|
-
client = Octokit::Client.new \
|
244
|
-
:login => 'defunkt',
|
245
|
-
:password => 'c0d3b4ssssss!'
|
246
|
-
|
247
|
-
client.create_authorization(:scopes => ["user"], :note => "Name of token",
|
248
|
-
:headers => { "X-GitHub-OTP" => "<your 2FA token>" })
|
249
|
-
# => <your new oauth token>
|
250
|
-
```
|
251
|
-
|
252
232
|
### Using a .netrc file
|
253
233
|
|
254
234
|
Octokit supports reading credentials from a netrc file (defaulting to
|
data/lib/octokit/client/apps.rb
CHANGED
@@ -217,6 +217,31 @@ module Octokit
|
|
217
217
|
def delete_installation(installation, options = {})
|
218
218
|
boolean_from_response :delete, "app/installations/#{installation}", options
|
219
219
|
end
|
220
|
+
|
221
|
+
# Returns a list of webhook deliveries for the webhook configured for a GitHub App.
|
222
|
+
#
|
223
|
+
# @param options [Hash] A customizable set of options
|
224
|
+
#
|
225
|
+
# @see https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook
|
226
|
+
#
|
227
|
+
# @return [Array<Hash>] an array of hook deliveries
|
228
|
+
def list_app_hook_deliveries(options = {})
|
229
|
+
paginate('app/hook/deliveries', options) do |data, last_response|
|
230
|
+
data.concat last_response.data
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
# Redeliver a delivery for the webhook configured for a GitHub App.
|
235
|
+
#
|
236
|
+
# @param delivery_id [Integer] The id of a GitHub App Hook Delivery
|
237
|
+
# @param options [Hash] A customizable set of options
|
238
|
+
#
|
239
|
+
# @see https://developer.github.com/v3/apps/#redeliver-a-delivery-for-an-app-webhook
|
240
|
+
#
|
241
|
+
# @return [Boolean] Success
|
242
|
+
def deliver_app_hook(delivery_id, options = {})
|
243
|
+
boolean_from_response :post, "app/hook/deliveries/#{delivery_id}/attempts", options
|
244
|
+
end
|
220
245
|
end
|
221
246
|
end
|
222
247
|
end
|
@@ -197,20 +197,21 @@ module Octokit
|
|
197
197
|
# @param body [String] Comment content
|
198
198
|
# @param commit_id [String] Sha of the commit to comment on.
|
199
199
|
# @param path [String] Relative path of the file to comment on.
|
200
|
-
# @param
|
200
|
+
# @param line [Integer] Line index in the diff to comment on.
|
201
|
+
# For a multi-line comment, the last line of the range
|
202
|
+
# and specify 'start_line' in the 'options'.
|
201
203
|
# @return [Sawyer::Resource] Hash representing the new comment
|
202
204
|
# @deprecated The position will be deprecated in the next major version. Please refer to the details below.
|
203
205
|
# @see https://developer.github.com/v3/pulls/comments/#create-a-comment
|
204
206
|
# @example
|
205
207
|
# @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:",
|
206
208
|
# "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47)
|
207
|
-
def create_pull_request_comment(repo, pull_id, body, commit_id, path,
|
208
|
-
octokit_warn 'Deprecated: The position will be deprecated in the next major version.'
|
209
|
+
def create_pull_request_comment(repo, pull_id, body, commit_id, path, line, options = {})
|
209
210
|
options.merge!({
|
210
211
|
body: body,
|
211
212
|
commit_id: commit_id,
|
212
213
|
path: path,
|
213
|
-
|
214
|
+
line: line
|
214
215
|
})
|
215
216
|
post "#{Repository.path repo}/pulls/#{pull_id}/comments", options
|
216
217
|
end
|
@@ -150,6 +150,55 @@ module Octokit
|
|
150
150
|
def delete_issue_reaction(repo, issue_id, reaction_id, options = {})
|
151
151
|
boolean_from_response :delete, "#{Repository.path repo}/issues/#{issue_id}/reactions/#{reaction_id}", options
|
152
152
|
end
|
153
|
+
|
154
|
+
# List reactions for a release
|
155
|
+
#
|
156
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
157
|
+
# @param id [Integer] The Release id
|
158
|
+
#
|
159
|
+
# @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release
|
160
|
+
#
|
161
|
+
# @example
|
162
|
+
# @client.release_reactions("octokit/octokit.rb", 1)
|
163
|
+
#
|
164
|
+
# @return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.
|
165
|
+
def release_reactions(repo, release_id, options = {})
|
166
|
+
get "#{Repository.path repo}/releases/#{release_id}/reactions", options
|
167
|
+
end
|
168
|
+
|
169
|
+
# Create reaction for a release
|
170
|
+
#
|
171
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
172
|
+
# @param id [Integer] The Release id
|
173
|
+
# @param reaction [String] The Reaction
|
174
|
+
#
|
175
|
+
# @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release
|
176
|
+
# @see https://developer.github.com/v3/reactions/#reaction-types
|
177
|
+
#
|
178
|
+
# @example
|
179
|
+
# @client.create_release_reaction("octokit/octokit.rb", 1)
|
180
|
+
#
|
181
|
+
# @return [<Sawyer::Resource>] Hash representing the reaction.
|
182
|
+
def create_release_reaction(repo, release_id, reaction, options = {})
|
183
|
+
options = options.merge(content: reaction)
|
184
|
+
post "#{Repository.path repo}/releases/#{release_id}/reactions", options
|
185
|
+
end
|
186
|
+
|
187
|
+
# Delete a reaction for a release
|
188
|
+
#
|
189
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
190
|
+
# @param issue_id [Integer] The Release id
|
191
|
+
# @param reaction_id [Integer] The Reaction id
|
192
|
+
#
|
193
|
+
# @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction
|
194
|
+
#
|
195
|
+
# @example
|
196
|
+
# @client.delete_release_reaction("octokit/octokit.rb", 1, 2)
|
197
|
+
#
|
198
|
+
# @return [Boolean] Return true if reaction was deleted, false otherwise.
|
199
|
+
def delete_release_reaction(repo, release_id, reaction_id, options = {})
|
200
|
+
boolean_from_response :delete, "#{Repository.path repo}/releases/#{release_id}/reactions/#{reaction_id}", options
|
201
|
+
end
|
153
202
|
end
|
154
203
|
end
|
155
204
|
end
|
data/lib/octokit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|