octokit 6.1.1 → 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/Rakefile +9 -3
- data/lib/octokit/client/actions_secrets.rb +58 -5
- data/lib/octokit/client/apps.rb +25 -0
- data/lib/octokit/client/code_scanning.rb +53 -0
- data/lib/octokit/client/codespaces_secrets.rb +59 -0
- data/lib/octokit/client/dependabot_secrets.rb +59 -0
- data/lib/octokit/client/organizations.rb +1 -1
- data/lib/octokit/client/pull_requests.rb +6 -3
- data/lib/octokit/client/reactions.rb +56 -5
- data/lib/octokit/client/reviews.rb +1 -1
- data/lib/octokit/client.rb +6 -0
- data/lib/octokit/repository.rb +2 -1
- data/lib/octokit/version.rb +3 -3
- data/octokit.gemspec +0 -1
- metadata +6 -23
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/Rakefile
CHANGED
@@ -3,12 +3,18 @@
|
|
3
3
|
require 'bundler'
|
4
4
|
Bundler::GemHelper.install_tasks
|
5
5
|
|
6
|
-
require 'rspec/core/rake_task'
|
7
|
-
RSpec::Core::RakeTask.new(:spec)
|
8
|
-
|
9
6
|
task test: :spec
|
10
7
|
task default: :spec
|
11
8
|
|
9
|
+
desc 'Run RSpec'
|
10
|
+
task :spec do
|
11
|
+
if Process.respond_to?(:fork)
|
12
|
+
sh('rspec-queue')
|
13
|
+
else
|
14
|
+
sh('rspec')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
namespace :doc do
|
13
19
|
require 'yard'
|
14
20
|
YARD::Rake::YardocTask.new do |task|
|
@@ -11,7 +11,7 @@ module Octokit
|
|
11
11
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
12
12
|
# @return [Hash] key_id and key
|
13
13
|
# @see https://developer.github.com/v3/actions/secrets/#get-your-public-key
|
14
|
-
def
|
14
|
+
def get_actions_public_key(repo)
|
15
15
|
get "#{Repository.path repo}/actions/secrets/public-key"
|
16
16
|
end
|
17
17
|
|
@@ -20,7 +20,7 @@ module Octokit
|
|
20
20
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
21
21
|
# @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at)
|
22
22
|
# @see https://developer.github.com/v3/actions/secrets/#list-secrets-for-a-repository
|
23
|
-
def
|
23
|
+
def list_actions_secrets(repo)
|
24
24
|
paginate "#{Repository.path repo}/actions/secrets" do |data, last_response|
|
25
25
|
data.secrets.concat last_response.data.secrets
|
26
26
|
end
|
@@ -32,7 +32,7 @@ module Octokit
|
|
32
32
|
# @param name [String] Name of secret
|
33
33
|
# @return [Hash] name, created_at and updated_at
|
34
34
|
# @see https://developer.github.com/v3/actions/secrets/#get-a-secret
|
35
|
-
def
|
35
|
+
def get_actions_secret(repo, name)
|
36
36
|
get "#{Repository.path repo}/actions/secrets/#{name}"
|
37
37
|
end
|
38
38
|
|
@@ -42,7 +42,7 @@ module Octokit
|
|
42
42
|
# @param name [String] Name of secret
|
43
43
|
# @param options [Hash] encrypted_value and key_id
|
44
44
|
# @see https://developer.github.com/v3/actions/secrets/#create-or-update-a-secret-for-a-repository
|
45
|
-
def
|
45
|
+
def create_or_update_actions_secret(repo, name, options)
|
46
46
|
put "#{Repository.path repo}/actions/secrets/#{name}", options
|
47
47
|
end
|
48
48
|
|
@@ -51,9 +51,62 @@ module Octokit
|
|
51
51
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
52
52
|
# @param name [String] Name of secret
|
53
53
|
# @see https://developer.github.com/v3/actions/secrets/#delete-a-secret-from-a-repository
|
54
|
-
def
|
54
|
+
def delete_actions_secret(repo, name)
|
55
55
|
boolean_from_response :delete, "#{Repository.path repo}/actions/secrets/#{name}"
|
56
56
|
end
|
57
|
+
|
58
|
+
# Get environment public key for secrets encryption
|
59
|
+
#
|
60
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
61
|
+
# @param environment [String] Name of environment
|
62
|
+
# @return [Hash] key_id and key
|
63
|
+
# @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key
|
64
|
+
def get_actions_environment_public_key(repo, environment)
|
65
|
+
get "#{Repository.path repo}/environments/#{environment}/secrets/public-key"
|
66
|
+
end
|
67
|
+
|
68
|
+
# List environment secrets
|
69
|
+
#
|
70
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
71
|
+
# @param environment [String] Name of environment
|
72
|
+
# @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at)
|
73
|
+
# @see https://developer.github.com/v3/actions/secrets/#list-environment-secrets
|
74
|
+
def list_actions_environment_secrets(repo, environment)
|
75
|
+
paginate "#{Repository.path repo}/environments/#{environment}/secrets" do |data, last_response|
|
76
|
+
data.secrets.concat last_response.data.secrets
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Get an environment secret
|
81
|
+
#
|
82
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
83
|
+
# @param environment [String] Name of environment
|
84
|
+
# @param name [String] Name of secret
|
85
|
+
# @return [Hash] name, created_at and updated_at
|
86
|
+
# @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret
|
87
|
+
def get_actions_environment_secret(repo, environment, name)
|
88
|
+
get "#{Repository.path repo}/environments/#{environment}/secrets/#{name}"
|
89
|
+
end
|
90
|
+
|
91
|
+
# Create or update an environment secret
|
92
|
+
#
|
93
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
94
|
+
# @param environment [String] Name of environment
|
95
|
+
# @param name [String] Name of secret
|
96
|
+
# @param options [Hash] encrypted_value and key_id
|
97
|
+
# @see https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret
|
98
|
+
def create_or_update_actions_environment_secret(repo, environment, name, options)
|
99
|
+
put "#{Repository.path repo}/environments/#{environment}/secrets/#{name}", options
|
100
|
+
end
|
101
|
+
|
102
|
+
# Delete environment secret
|
103
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
104
|
+
# @param environment [String] Name of environment
|
105
|
+
# @param name [String] Name of secret
|
106
|
+
# @see https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret
|
107
|
+
def delete_actions_environment_secret(repo, environment, name)
|
108
|
+
boolean_from_response :delete, "#{Repository.path repo}/environments/#{environment}/secrets/#{name}"
|
109
|
+
end
|
57
110
|
end
|
58
111
|
end
|
59
112
|
end
|
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
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'base64'
|
4
|
+
require 'tempfile'
|
5
|
+
require 'zlib'
|
6
|
+
|
7
|
+
module Octokit
|
8
|
+
class Client
|
9
|
+
# Methods for the code scanning alerts API
|
10
|
+
#
|
11
|
+
# @see https://docs.github.com/rest/code-scanning
|
12
|
+
module CodeScanning
|
13
|
+
# Uploads SARIF data containing the results of a code scanning analysis
|
14
|
+
#
|
15
|
+
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
16
|
+
# @param file [String] Path to the SARIF file to upload
|
17
|
+
# @param sha [String] The SHA of the commit to which the analysis you are uploading relates
|
18
|
+
# @param ref [String] The full Git reference, formatted as `refs/heads/<branch name>`, `refs/pull/<number>/merge`, or `refs/pull/<number>/head`
|
19
|
+
#
|
20
|
+
# @return [Sawyer::Resource] SARIF upload information
|
21
|
+
# @see https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data
|
22
|
+
def upload_sarif_data(repo, file, sha, ref, options = {})
|
23
|
+
options[:sarif] = compress_sarif_data(file)
|
24
|
+
options[:commit_sha] = sha
|
25
|
+
options[:ref] = ref
|
26
|
+
|
27
|
+
post "#{Repository.path repo}/code-scanning/sarifs", options
|
28
|
+
end
|
29
|
+
|
30
|
+
# Gets information about a SARIF upload
|
31
|
+
#
|
32
|
+
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
33
|
+
# @param sarif_id [String] The SARIF ID obtained after uploading
|
34
|
+
#
|
35
|
+
# @return [Sawyer::Resource] SARIF upload information
|
36
|
+
# @see https://docs.github.com/rest/code-scanning#get-information-about-a-sarif-upload
|
37
|
+
def get_sarif_upload_information(repo, sarif_id, options = {})
|
38
|
+
get "#{Repository.path repo}/code-scanning/sarifs/#{sarif_id}", options
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def compress_sarif_data(file)
|
44
|
+
Tempfile.create('sarif.gz') do |tempfile|
|
45
|
+
Zlib::GzipWriter.open(tempfile) do |gz_file|
|
46
|
+
gz_file.write File.binread(file)
|
47
|
+
end
|
48
|
+
Base64.strict_encode64(tempfile.read)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Octokit
|
4
|
+
class Client
|
5
|
+
# Methods for the Codespaces Secrets API
|
6
|
+
#
|
7
|
+
# @see https://docs.github.com/en/rest/codespaces/
|
8
|
+
module CodespacesSecrets
|
9
|
+
# Get public key for secrets encryption
|
10
|
+
#
|
11
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
12
|
+
# @return [Hash] key_id and key
|
13
|
+
# @see https://docs.github.com/en/rest/codespaces/repository-secrets#get-a-repository-public-key
|
14
|
+
def get_codespaces_public_key(repo)
|
15
|
+
get "#{Repository.path repo}/codespaces/secrets/public-key"
|
16
|
+
end
|
17
|
+
|
18
|
+
# List secrets
|
19
|
+
#
|
20
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
21
|
+
# @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at)
|
22
|
+
# @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets
|
23
|
+
def list_codespaces_secrets(repo)
|
24
|
+
paginate "#{Repository.path repo}/codespaces/secrets" do |data, last_response|
|
25
|
+
data.secrets.concat last_response.data.secrets
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get a secret
|
30
|
+
#
|
31
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
32
|
+
# @param name [String] Name of secret
|
33
|
+
# @return [Hash] name, created_at, updated_at, and visibility
|
34
|
+
# @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret
|
35
|
+
def get_codespaces_secret(repo, name)
|
36
|
+
get "#{Repository.path repo}/codespaces/secrets/#{name}"
|
37
|
+
end
|
38
|
+
|
39
|
+
# Create or update secrets
|
40
|
+
#
|
41
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
42
|
+
# @param name [String] Name of secret
|
43
|
+
# @param options [Hash] encrypted_value and key_id
|
44
|
+
# @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
|
45
|
+
def create_or_update_codespaces_secret(repo, name, options)
|
46
|
+
put "#{Repository.path repo}/codespaces/secrets/#{name}", options
|
47
|
+
end
|
48
|
+
|
49
|
+
# Delete a secret
|
50
|
+
#
|
51
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
52
|
+
# @param name [String] Name of secret
|
53
|
+
# @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret
|
54
|
+
def delete_codespaces_secret(repo, name)
|
55
|
+
boolean_from_response :delete, "#{Repository.path repo}/codespaces/secrets/#{name}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Octokit
|
4
|
+
class Client
|
5
|
+
# Methods for the dependabot Secrets API
|
6
|
+
#
|
7
|
+
# @see https://docs.github.com/en/rest/dependabot/
|
8
|
+
module DependabotSecrets
|
9
|
+
# Get public key for secrets encryption
|
10
|
+
#
|
11
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
12
|
+
# @return [Hash] key_id and key
|
13
|
+
# @see https://docs.github.com/en/rest/dependabot/repository-secrets#get-a-repository-public-key
|
14
|
+
def get_dependabot_public_key(repo)
|
15
|
+
get "#{Repository.path repo}/dependabot/secrets/public-key"
|
16
|
+
end
|
17
|
+
|
18
|
+
# List secrets
|
19
|
+
#
|
20
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
21
|
+
# @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at)
|
22
|
+
# @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#list-repository-secrets
|
23
|
+
def list_dependabot_secrets(repo)
|
24
|
+
paginate "#{Repository.path repo}/dependabot/secrets" do |data, last_response|
|
25
|
+
data.secrets.concat last_response.data.secrets
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get a secret
|
30
|
+
#
|
31
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
32
|
+
# @param name [String] Name of secret
|
33
|
+
# @return [Hash] name, created_at, updated_at, and visibility
|
34
|
+
# @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret
|
35
|
+
def get_dependabot_secret(repo, name)
|
36
|
+
get "#{Repository.path repo}/dependabot/secrets/#{name}"
|
37
|
+
end
|
38
|
+
|
39
|
+
# Create or update secrets
|
40
|
+
#
|
41
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
42
|
+
# @param name [String] Name of secret
|
43
|
+
# @param options [Hash] encrypted_value and key_id
|
44
|
+
# @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
|
45
|
+
def create_or_update_dependabot_secret(repo, name, options)
|
46
|
+
put "#{Repository.path repo}/dependabot/secrets/#{name}", options
|
47
|
+
end
|
48
|
+
|
49
|
+
# Delete a secret
|
50
|
+
#
|
51
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
52
|
+
# @param name [String] Name of secret
|
53
|
+
# @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret
|
54
|
+
def delete_dependabot_secret(repo, name)
|
55
|
+
boolean_from_response :delete, "#{Repository.path repo}/dependabot/secrets/#{name}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -71,7 +71,7 @@ module Octokit
|
|
71
71
|
# Nonauthenticated calls to this method will return organizations that
|
72
72
|
# the user is a public member.
|
73
73
|
#
|
74
|
-
# Use an
|
74
|
+
# Use an authenticated client to get both public and private organizations
|
75
75
|
# for a user.
|
76
76
|
#
|
77
77
|
# Calling this method on a `@client` will return that users organizations.
|
@@ -197,18 +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
|
204
|
+
# @deprecated The position will be deprecated in the next major version. Please refer to the details below.
|
202
205
|
# @see https://developer.github.com/v3/pulls/comments/#create-a-comment
|
203
206
|
# @example
|
204
207
|
# @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:",
|
205
208
|
# "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47)
|
206
|
-
def create_pull_request_comment(repo, pull_id, body, commit_id, path,
|
209
|
+
def create_pull_request_comment(repo, pull_id, body, commit_id, path, line, options = {})
|
207
210
|
options.merge!({
|
208
211
|
body: body,
|
209
212
|
commit_id: commit_id,
|
210
213
|
path: path,
|
211
|
-
|
214
|
+
line: line
|
212
215
|
})
|
213
216
|
post "#{Repository.path repo}/pulls/#{pull_id}/comments", options
|
214
217
|
end
|
@@ -137,16 +137,67 @@ module Octokit
|
|
137
137
|
|
138
138
|
# Delete a reaction
|
139
139
|
#
|
140
|
-
# @param
|
140
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
141
|
+
# @param issue_id [Integer] The Issue comment id
|
142
|
+
# @param reaction_id [Integer] The Reaction id
|
143
|
+
#
|
144
|
+
# @see https://docs.github.com/en/rest/reactions/reactions#delete-an-issue-reaction
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
# @client.delete_issue_reaction("octokit/octokit.rb", 1, 2)
|
148
|
+
#
|
149
|
+
# @return [Boolean] Return true if reaction was deleted, false otherwise.
|
150
|
+
def delete_issue_reaction(repo, issue_id, reaction_id, options = {})
|
151
|
+
boolean_from_response :delete, "#{Repository.path repo}/issues/#{issue_id}/reactions/#{reaction_id}", options
|
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
|
141
192
|
#
|
142
|
-
# @see https://
|
193
|
+
# @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction
|
143
194
|
#
|
144
195
|
# @example
|
145
|
-
# @client.
|
196
|
+
# @client.delete_release_reaction("octokit/octokit.rb", 1, 2)
|
146
197
|
#
|
147
198
|
# @return [Boolean] Return true if reaction was deleted, false otherwise.
|
148
|
-
def
|
149
|
-
boolean_from_response :delete, "reactions/#{
|
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
|
150
201
|
end
|
151
202
|
end
|
152
203
|
end
|
@@ -151,7 +151,7 @@ module Octokit
|
|
151
151
|
# @param number [Integer] Number ID of the pull request
|
152
152
|
# @param reviewers [Hash] :reviewers [Array<String>] An array of user logins
|
153
153
|
# @param options [Hash] :team_reviewers [Array<String>] An array of team slugs
|
154
|
-
# @see https://developer.github.com/v3/pulls/review_requests/#
|
154
|
+
# @see https://developer.github.com/v3/pulls/review_requests/#request-reviewers-for-a-pull-request
|
155
155
|
#
|
156
156
|
# @example
|
157
157
|
# @client.request_pull_request_review('octokit/octokit.rb', 2, reviewers: ['soudy'])
|
data/lib/octokit/client.rb
CHANGED
@@ -18,6 +18,8 @@ require 'octokit/client/actions_workflow_jobs'
|
|
18
18
|
require 'octokit/client/actions_workflow_runs'
|
19
19
|
require 'octokit/client/apps'
|
20
20
|
require 'octokit/client/checks'
|
21
|
+
require 'octokit/client/code_scanning'
|
22
|
+
require 'octokit/client/codespaces_secrets'
|
21
23
|
require 'octokit/client/commits'
|
22
24
|
require 'octokit/client/commit_comments'
|
23
25
|
require 'octokit/client/commit_pulls'
|
@@ -25,6 +27,7 @@ require 'octokit/client/commit_branches'
|
|
25
27
|
require 'octokit/client/community_profile'
|
26
28
|
require 'octokit/client/contents'
|
27
29
|
require 'octokit/client/downloads'
|
30
|
+
require 'octokit/client/dependabot_secrets'
|
28
31
|
require 'octokit/client/deployments'
|
29
32
|
require 'octokit/client/environments'
|
30
33
|
require 'octokit/client/emojis'
|
@@ -79,12 +82,15 @@ module Octokit
|
|
79
82
|
include Octokit::Client::ActionsArtifacts
|
80
83
|
include Octokit::Client::ActionsSecrets
|
81
84
|
include Octokit::Client::Checks
|
85
|
+
include Octokit::Client::CodeScanning
|
86
|
+
include Octokit::Client::CodespacesSecrets
|
82
87
|
include Octokit::Client::Commits
|
83
88
|
include Octokit::Client::CommitComments
|
84
89
|
include Octokit::Client::CommitPulls
|
85
90
|
include Octokit::Client::CommitBranches
|
86
91
|
include Octokit::Client::CommunityProfile
|
87
92
|
include Octokit::Client::Contents
|
93
|
+
include Octokit::Client::DependabotSecrets
|
88
94
|
include Octokit::Client::Deployments
|
89
95
|
include Octokit::Client::Downloads
|
90
96
|
include Octokit::Client::Environments
|
data/lib/octokit/repository.rb
CHANGED
data/lib/octokit/version.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
module Octokit
|
4
4
|
# Current major release.
|
5
5
|
# @return [Integer]
|
6
|
-
MAJOR =
|
6
|
+
MAJOR = 8
|
7
7
|
|
8
8
|
# Current minor release.
|
9
9
|
# @return [Integer]
|
10
|
-
MINOR =
|
10
|
+
MINOR = 0
|
11
11
|
|
12
12
|
# Current patch level.
|
13
13
|
# @return [Integer]
|
14
|
-
PATCH =
|
14
|
+
PATCH = 0
|
15
15
|
|
16
16
|
# Full release version.
|
17
17
|
# @return [String]
|
data/octokit.gemspec
CHANGED
@@ -5,7 +5,6 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'octokit/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.add_development_dependency 'bundler', '>= 1', '< 3'
|
9
8
|
spec.add_dependency 'faraday', '>= 1', '< 3'
|
10
9
|
spec.add_dependency 'sawyer', '~> 0.9'
|
11
10
|
spec.authors = ['Wynn Netherland', 'Erik Michaels-Ober', 'Clint Shryock']
|
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,28 +10,8 @@ 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
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: bundler
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '1'
|
22
|
-
- - "<"
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '3'
|
25
|
-
type: :development
|
26
|
-
prerelease: false
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ">="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: '1'
|
32
|
-
- - "<"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '3'
|
35
15
|
- !ruby/object:Gem::Dependency
|
36
16
|
name: faraday
|
37
17
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,12 +72,15 @@ files:
|
|
92
72
|
- lib/octokit/client/actions_workflows.rb
|
93
73
|
- lib/octokit/client/apps.rb
|
94
74
|
- lib/octokit/client/checks.rb
|
75
|
+
- lib/octokit/client/code_scanning.rb
|
76
|
+
- lib/octokit/client/codespaces_secrets.rb
|
95
77
|
- lib/octokit/client/commit_branches.rb
|
96
78
|
- lib/octokit/client/commit_comments.rb
|
97
79
|
- lib/octokit/client/commit_pulls.rb
|
98
80
|
- lib/octokit/client/commits.rb
|
99
81
|
- lib/octokit/client/community_profile.rb
|
100
82
|
- lib/octokit/client/contents.rb
|
83
|
+
- lib/octokit/client/dependabot_secrets.rb
|
101
84
|
- lib/octokit/client/deployments.rb
|
102
85
|
- lib/octokit/client/downloads.rb
|
103
86
|
- lib/octokit/client/emojis.rb
|
@@ -184,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
167
|
- !ruby/object:Gem::Version
|
185
168
|
version: 1.3.5
|
186
169
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
170
|
+
rubygems_version: 3.4.0.dev
|
188
171
|
signing_key:
|
189
172
|
specification_version: 4
|
190
173
|
summary: Ruby toolkit for working with the GitHub API
|