octokit 4.20.0 → 4.22.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 +4 -4
- data/README.md +8 -6
- data/lib/octokit/client/actions_workflow_runs.rb +11 -0
- data/lib/octokit/client/apps.rb +1 -2
- data/lib/octokit/client/checks.rb +0 -20
- data/lib/octokit/client/commits.rb +6 -1
- data/lib/octokit/client/organizations.rb +20 -6
- data/lib/octokit/client/pub_sub_hubbub.rb +2 -2
- data/lib/octokit/client/refs.rb +13 -1
- data/lib/octokit/client/repositories.rb +18 -0
- data/lib/octokit/client.rb +3 -3
- data/lib/octokit/connection.rb +5 -5
- data/lib/octokit/error.rb +6 -0
- data/lib/octokit/middleware/follow_redirects.rb +4 -1
- data/lib/octokit/preview.rb +0 -3
- data/lib/octokit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072c9ec7fa2439cc75655ff5c925efeedc19fe386eae30a30be712524802b3ad
|
4
|
+
data.tar.gz: 177806faf28428ecd942d0159c268cae122e2ec7a88d4bc3e0b34e41a2b3409c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a087ec2c360f33db0cd6526ba76ae8762d57885a24577d36ada1baf1cf3019e93beeaa70455bb6cf08f64d9328e84112043d202526b42e94f8cb1bfb96faada
|
7
|
+
data.tar.gz: 8425341fe9135936b066de860c2722ad77b8a3c3ce2d8fe478a5420a3c911fc56a419ce4808a290f55199074bab94953500d3cdbc7345f9d9137d66cccb9de39
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Ruby toolkit for the GitHub API.
|
4
4
|
|
5
|
-

|
6
6
|
|
7
7
|
Upgrading? Check the [Upgrade Guide](#upgrading-guide) before bumping to a new
|
8
8
|
[major version][semver].
|
@@ -86,10 +86,10 @@ Access the library in Ruby:
|
|
86
86
|
|
87
87
|
```ruby
|
88
88
|
# Provide authentication credentials
|
89
|
-
client = Octokit::Client.new(:
|
89
|
+
client = Octokit::Client.new(:access_token => 'personal_access_token')
|
90
90
|
|
91
|
-
#
|
92
|
-
# client = Octokit::Client.new(:
|
91
|
+
# You can still use the username/password syntax by replacing the password value with your PAT.
|
92
|
+
# client = Octokit::Client.new(:login => 'defunkt', :password => 'personal_access_token')
|
93
93
|
|
94
94
|
# Fetch the current user
|
95
95
|
client.user
|
@@ -323,7 +323,7 @@ custom pattern for traversing large lists.
|
|
323
323
|
|
324
324
|
## Working with GitHub Enterprise
|
325
325
|
|
326
|
-
With a bit of setup, you can also use Octokit with your
|
326
|
+
With a bit of setup, you can also use Octokit with your GitHub Enterprise instance.
|
327
327
|
|
328
328
|
### Interacting with the GitHub.com APIs in GitHub Enterprise
|
329
329
|
|
@@ -584,7 +584,9 @@ stack = Faraday::RackBuilder.new do |builder|
|
|
584
584
|
builder.use Octokit::Middleware::FollowRedirects
|
585
585
|
builder.use Octokit::Response::RaiseError
|
586
586
|
builder.use Octokit::Response::FeedParser
|
587
|
-
builder.response :logger
|
587
|
+
builder.response :logger do |logger|
|
588
|
+
logger.filter(/(Authorization: "(token|Bearer) )(\w+)/, '\1[REMOVED]')
|
589
|
+
end
|
588
590
|
builder.adapter Faraday.default_adapter
|
589
591
|
end
|
590
592
|
Octokit.middleware = stack
|
@@ -65,6 +65,17 @@ module Octokit
|
|
65
65
|
boolean_from_response :post, "#{Repository.path repo}/actions/runs/#{id}/cancel", options
|
66
66
|
end
|
67
67
|
|
68
|
+
# Deletes a workflow run
|
69
|
+
#
|
70
|
+
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
71
|
+
# @param id [Integer] Id of a workflow run
|
72
|
+
#
|
73
|
+
# @return [Boolean] Returns true if the run is deleted
|
74
|
+
# @see https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run
|
75
|
+
def delete_workflow_run(repo, id, options = {})
|
76
|
+
boolean_from_response :delete, "#{Repository.path repo}/actions/runs/#{id}", options
|
77
|
+
end
|
78
|
+
|
68
79
|
# Get a download url for archived log files of a workflow run
|
69
80
|
#
|
70
81
|
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
data/lib/octokit/client/apps.rb
CHANGED
@@ -215,8 +215,7 @@ module Octokit
|
|
215
215
|
#
|
216
216
|
# @return [Boolean] Success
|
217
217
|
def delete_installation(installation, options = {})
|
218
|
-
|
219
|
-
boolean_from_response :delete, "app/installations/#{installation}", opts
|
218
|
+
boolean_from_response :delete, "app/installations/#{installation}", options
|
220
219
|
end
|
221
220
|
end
|
222
221
|
end
|
@@ -23,7 +23,6 @@ module Octokit
|
|
23
23
|
# check_run.head_sha # => "7638417db6d59f3c431d3e1f261cc637155684cd"
|
24
24
|
# check_run.status # => "queued"
|
25
25
|
def create_check_run(repo, name, head_sha, options = {})
|
26
|
-
ensure_api_media_type(:checks, options)
|
27
26
|
options[:name] = name
|
28
27
|
options[:head_sha] = head_sha
|
29
28
|
|
@@ -41,8 +40,6 @@ module Octokit
|
|
41
40
|
# check_run.id # => 51295429
|
42
41
|
# check_run.status # => "in_progress"
|
43
42
|
def update_check_run(repo, id, options = {})
|
44
|
-
ensure_api_media_type(:checks, options)
|
45
|
-
|
46
43
|
patch "#{Repository.path repo}/check-runs/#{id}", options
|
47
44
|
end
|
48
45
|
|
@@ -63,8 +60,6 @@ module Octokit
|
|
63
60
|
# result.check_runs[0].id # => 51295429
|
64
61
|
# result.check_runs[0].status # => "in_progress"
|
65
62
|
def check_runs_for_ref(repo, ref, options = {})
|
66
|
-
ensure_api_media_type(:checks, options)
|
67
|
-
|
68
63
|
get "#{Repository.path repo}/commits/#{ref}/check-runs", options
|
69
64
|
end
|
70
65
|
alias :list_check_runs_for_ref :check_runs_for_ref
|
@@ -86,8 +81,6 @@ module Octokit
|
|
86
81
|
# result.check_runs[0].check_suite.id # => 50440400
|
87
82
|
# result.check_runs[0].status # => "in_progress"
|
88
83
|
def check_runs_for_check_suite(repo, id, options = {})
|
89
|
-
ensure_api_media_type(:checks, options)
|
90
|
-
|
91
84
|
get "#{Repository.path repo}/check-suites/#{id}/check-runs", options
|
92
85
|
end
|
93
86
|
alias :list_check_runs_for_check_suite :check_runs_for_check_suite
|
@@ -99,8 +92,6 @@ module Octokit
|
|
99
92
|
# @return [Sawyer::Resource] A hash representing the check run
|
100
93
|
# @see https://developer.github.com/v3/checks/runs/#get-a-single-check-run
|
101
94
|
def check_run(repo, id, options = {})
|
102
|
-
ensure_api_media_type(:checks, options)
|
103
|
-
|
104
95
|
get "#{Repository.path repo}/check-runs/#{id}", options
|
105
96
|
end
|
106
97
|
|
@@ -116,8 +107,6 @@ module Octokit
|
|
116
107
|
# annotations[0].path # => "README.md"
|
117
108
|
# annotations[0].message # => "Looks good!"
|
118
109
|
def check_run_annotations(repo, id, options = {})
|
119
|
-
ensure_api_media_type(:checks, options)
|
120
|
-
|
121
110
|
get "#{Repository.path repo}/check-runs/#{id}/annotations", options
|
122
111
|
end
|
123
112
|
|
@@ -132,8 +121,6 @@ module Octokit
|
|
132
121
|
# @return [Sawyer::Resource] A hash representing the check suite
|
133
122
|
# @see https://developer.github.com/v3/checks/suites/#get-a-single-check-suite
|
134
123
|
def check_suite(repo, id, options = {})
|
135
|
-
ensure_api_media_type(:checks, options)
|
136
|
-
|
137
124
|
get "#{Repository.path repo}/check-suites/#{id}", options
|
138
125
|
end
|
139
126
|
|
@@ -153,8 +140,6 @@ module Octokit
|
|
153
140
|
# result.check_suites[0].id # => 50440400
|
154
141
|
# result.check_suites[0].app.id # => 76765
|
155
142
|
def check_suites_for_ref(repo, ref, options = {})
|
156
|
-
ensure_api_media_type(:checks, options)
|
157
|
-
|
158
143
|
get "#{Repository.path repo}/commits/#{ref}/check-suites", options
|
159
144
|
end
|
160
145
|
alias :list_check_suites_for_ref :check_suites_for_ref
|
@@ -172,8 +157,6 @@ module Octokit
|
|
172
157
|
# result.preferences.auto_trigger_checks[0].setting # => false
|
173
158
|
# result.repository.full_name # => "octocat/Hello-World"
|
174
159
|
def set_check_suite_preferences(repo, options = {})
|
175
|
-
ensure_api_media_type(:checks, options)
|
176
|
-
|
177
160
|
patch "#{Repository.path repo}/check-suites/preferences", options
|
178
161
|
end
|
179
162
|
|
@@ -188,7 +171,6 @@ module Octokit
|
|
188
171
|
# check_suite.head_sha # => "7638417db6d59f3c431d3e1f261cc637155684cd"
|
189
172
|
# check_suite.status # => "queued"
|
190
173
|
def create_check_suite(repo, head_sha, options = {})
|
191
|
-
ensure_api_media_type(:checks, options)
|
192
174
|
options[:head_sha] = head_sha
|
193
175
|
|
194
176
|
post "#{Repository.path repo}/check-suites", options
|
@@ -201,8 +183,6 @@ module Octokit
|
|
201
183
|
# @return [Boolean] True if successful, raises an error otherwise
|
202
184
|
# @see https://developer.github.com/v3/checks/suites/#rerequest-check-suite
|
203
185
|
def rerequest_check_suite(repo, id, options = {})
|
204
|
-
ensure_api_media_type(:checks, options)
|
205
|
-
|
206
186
|
post "#{Repository.path repo}/check-suites/#{id}/rerequest", options
|
207
187
|
true
|
208
188
|
end
|
@@ -189,13 +189,18 @@ module Octokit
|
|
189
189
|
|
190
190
|
# Compare two commits
|
191
191
|
#
|
192
|
+
# When using auto_pagination, commits from all pages will be concatenated
|
193
|
+
# into the <tt>commits</tt> attribute of the first page's response.
|
194
|
+
#
|
192
195
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
193
196
|
# @param start [String] The sha of the starting commit
|
194
197
|
# @param endd [String] The sha of the ending commit
|
195
198
|
# @return [Sawyer::Resource] A hash representing the comparison
|
196
199
|
# @see https://developer.github.com/v3/repos/commits/#compare-two-commits
|
197
200
|
def compare(repo, start, endd, options = {})
|
198
|
-
|
201
|
+
paginate "#{Repository.path repo}/compare/#{start}...#{endd}", options do |data, last_response|
|
202
|
+
data.commits.concat last_response.data.commits
|
203
|
+
end
|
199
204
|
end
|
200
205
|
|
201
206
|
# Merge a branch or sha
|
@@ -731,7 +731,7 @@ module Octokit
|
|
731
731
|
# @return [Sawyer::Resource] Hash representing the new migration.
|
732
732
|
# @example
|
733
733
|
# @client.start_migration('github', ['github/dotfiles'])
|
734
|
-
# @see https://
|
734
|
+
# @see https://docs.github.com/en/rest/reference/migrations#start-an-organization-migration
|
735
735
|
def start_migration(org, repositories, options = {})
|
736
736
|
options = ensure_api_media_type(:migrations, options)
|
737
737
|
options[:repositories] = repositories
|
@@ -744,7 +744,7 @@ module Octokit
|
|
744
744
|
#
|
745
745
|
# @param org [String, Integer] Organization GitHub login or id.
|
746
746
|
# @return [Array<Sawyer::Resource>] Array of migration resources.
|
747
|
-
# @see https://
|
747
|
+
# @see https://docs.github.com/en/rest/reference/migrations#list-organization-migrations
|
748
748
|
def migrations(org, options = {})
|
749
749
|
options = ensure_api_media_type(:migrations, options)
|
750
750
|
paginate "#{Organization.path(org)}/migrations", options
|
@@ -756,7 +756,7 @@ module Octokit
|
|
756
756
|
#
|
757
757
|
# @param org [String, Integer] Organization GitHub login or id.
|
758
758
|
# @param id [Integer] ID number of the migration.
|
759
|
-
# @see https://
|
759
|
+
# @see https://docs.github.com/en/rest/reference/migrations#get-an-organization-migration-status
|
760
760
|
def migration_status(org, id, options = {})
|
761
761
|
options = ensure_api_media_type(:migrations, options)
|
762
762
|
get "#{Organization.path(org)}/migrations/#{id}", options
|
@@ -768,7 +768,7 @@ module Octokit
|
|
768
768
|
#
|
769
769
|
# @param org [String, Integer] Organization GitHub login or id.
|
770
770
|
# @param id [Integer] ID number of the migration.
|
771
|
-
# @see https://
|
771
|
+
# @see https://docs.github.com/en/rest/reference/migrations#download-an-organization-migration-archive
|
772
772
|
def migration_archive_url(org, id, options = {})
|
773
773
|
options = ensure_api_media_type(:migrations, options)
|
774
774
|
url = "#{Organization.path(org)}/migrations/#{id}/archive"
|
@@ -783,7 +783,7 @@ module Octokit
|
|
783
783
|
#
|
784
784
|
# @param org [String, Integer] Organization GitHub login or id.
|
785
785
|
# @param id [Integer] ID number of the migration.
|
786
|
-
# @see https://
|
786
|
+
# @see https://docs.github.com/en/rest/reference/migrations#delete-an-organization-migration-archive
|
787
787
|
def delete_migration_archive(org, id, options = {})
|
788
788
|
options = ensure_api_media_type(:migrations, options)
|
789
789
|
delete "#{Organization.path(org)}/migrations/#{id}/archive", options
|
@@ -796,11 +796,25 @@ module Octokit
|
|
796
796
|
# @param org [String, Integer] Organization GitHub login or id.
|
797
797
|
# @param id [Integer] ID number of the migration.
|
798
798
|
# @param repo [String] Name of the repository.
|
799
|
-
# @see https://
|
799
|
+
# @see https://docs.github.com/en/rest/reference/migrations#unlock-an-organization-repository
|
800
800
|
def unlock_repository(org, id, repo, options = {})
|
801
801
|
options = ensure_api_media_type(:migrations, options)
|
802
802
|
delete "#{Organization.path(org)}/migrations/#{id}/repos/#{repo}/lock", options
|
803
803
|
end
|
804
|
+
|
805
|
+
# Get GitHub Actions billing for an organization
|
806
|
+
#
|
807
|
+
# Requires authenticated organization owner.
|
808
|
+
#
|
809
|
+
# @param org [String, Integer] Organization GitHub login or id.
|
810
|
+
# @return [Sawyer::Resource] Hash representing GitHub Actions billing for an organization.
|
811
|
+
# @see https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-an-organization
|
812
|
+
#
|
813
|
+
# @example
|
814
|
+
# @client.billing_actions('github')
|
815
|
+
def billing_actions(org)
|
816
|
+
get "#{Organization.path(org)}/settings/billing/actions"
|
817
|
+
end
|
804
818
|
end
|
805
819
|
end
|
806
820
|
end
|
@@ -91,9 +91,9 @@ module Octokit
|
|
91
91
|
conn = Faraday.new(:url => @api_endpoint) do |http|
|
92
92
|
http.headers[:user_agent] = user_agent
|
93
93
|
if basic_authenticated?
|
94
|
-
http.basic_auth
|
94
|
+
http.request :basic_auth, @login, @password
|
95
95
|
elsif token_authenticated?
|
96
|
-
http.authorization 'token', @access_token
|
96
|
+
http.request :authorization, 'token', @access_token
|
97
97
|
end
|
98
98
|
http.request :url_encoded
|
99
99
|
http.use Octokit::Response::RaiseError
|
data/lib/octokit/client/refs.rb
CHANGED
@@ -23,6 +23,18 @@ module Octokit
|
|
23
23
|
alias :references :refs
|
24
24
|
alias :list_references :refs
|
25
25
|
|
26
|
+
# Fetch matching refs
|
27
|
+
#
|
28
|
+
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
29
|
+
# @param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt> or <tt>heads/rails-3</tt>
|
30
|
+
# @return [Array<Sawyer::Resource>] The reference matching the given repo and the ref id
|
31
|
+
# @see https://developer.github.com/v3/git/refs/#list-matching-references
|
32
|
+
# @example Fetch refs matching tags/v2 for sferik/rails_admin
|
33
|
+
# Octokit.ref("sferik/rails_admin","tags/v2")
|
34
|
+
def matching_refs(repo, ref, options = {})
|
35
|
+
paginate "#{Repository.path repo}/git/matching-refs/#{ref}", options
|
36
|
+
end
|
37
|
+
|
26
38
|
# Fetch a given reference
|
27
39
|
#
|
28
40
|
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
@@ -46,7 +58,7 @@ module Octokit
|
|
46
58
|
# @example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132
|
47
59
|
# Octokit.create_ref("octocat/Hello-World", "heads/master", "827efc6d56897b048c772eb4087f854f46256132")
|
48
60
|
def create_ref(repo, ref, sha, options = {})
|
49
|
-
ref = "refs/#{ref}" unless ref =~ %r{
|
61
|
+
ref = "refs/#{ref}" unless ref =~ %r{\Arefs/}
|
50
62
|
parameters = {
|
51
63
|
:ref => ref,
|
52
64
|
:sha => sha
|
@@ -640,6 +640,24 @@ module Octokit
|
|
640
640
|
boolean_from_response :delete, "#{Repository.path repo}/branches/#{branch}/protection", opts
|
641
641
|
end
|
642
642
|
|
643
|
+
# Rename a single branch from a repository
|
644
|
+
#
|
645
|
+
# Requires authenticated client
|
646
|
+
#
|
647
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository.
|
648
|
+
# @param branch [String] Current branch name
|
649
|
+
# @param new_name [String] New branch name
|
650
|
+
# @return [Sawyer::Resource] The renamed branch
|
651
|
+
# @see https://developer.github.com/v3/repos/#rename-a-branch
|
652
|
+
# @example
|
653
|
+
# @client.rename_branch('octokit/octokit.rb', 'master', 'main')
|
654
|
+
def rename_branch(repo, branch, new_name, options = {})
|
655
|
+
params = {
|
656
|
+
new_name: new_name,
|
657
|
+
}
|
658
|
+
post "#{Repository.path repo}/branches/#{branch}/rename", params.merge(options)
|
659
|
+
end
|
660
|
+
|
643
661
|
# List users available for assigning to issues.
|
644
662
|
#
|
645
663
|
# Requires authenticated client for private repos.
|
data/lib/octokit/client.rb
CHANGED
@@ -238,11 +238,11 @@ module Octokit
|
|
238
238
|
conn_opts[:ssl] = { :verify_mode => @ssl_verify_mode } if @ssl_verify_mode
|
239
239
|
conn = Faraday.new(conn_opts) do |http|
|
240
240
|
if basic_authenticated?
|
241
|
-
http.basic_auth
|
241
|
+
http.request :basic_auth, @login, @password
|
242
242
|
elsif token_authenticated?
|
243
|
-
http.authorization 'token', @access_token
|
243
|
+
http.request :authorization, 'token', @access_token
|
244
244
|
elsif bearer_authenticated?
|
245
|
-
http.authorization 'Bearer', @bearer_token
|
245
|
+
http.request :authorization, 'Bearer', @bearer_token
|
246
246
|
end
|
247
247
|
http.headers['accept'] = options[:accept] if options.key?(:accept)
|
248
248
|
end
|
data/lib/octokit/connection.rb
CHANGED
@@ -107,13 +107,13 @@ module Octokit
|
|
107
107
|
http.headers[:content_type] = "application/json"
|
108
108
|
http.headers[:user_agent] = user_agent
|
109
109
|
if basic_authenticated?
|
110
|
-
http.basic_auth
|
110
|
+
http.request :basic_auth, @login, @password
|
111
111
|
elsif token_authenticated?
|
112
|
-
http.authorization 'token', @access_token
|
112
|
+
http.request :authorization, 'token', @access_token
|
113
113
|
elsif bearer_authenticated?
|
114
|
-
http.authorization 'Bearer', @bearer_token
|
114
|
+
http.request :authorization, 'Bearer', @bearer_token
|
115
115
|
elsif application_authenticated?
|
116
|
-
http.basic_auth
|
116
|
+
http.request :basic_auth, @client_id, @client_secret
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
@@ -176,7 +176,7 @@ module Octokit
|
|
176
176
|
:links_parser => Sawyer::LinkParsers::Simple.new
|
177
177
|
}
|
178
178
|
conn_opts = @connection_options
|
179
|
-
conn_opts[:builder] = @middleware if @middleware
|
179
|
+
conn_opts[:builder] = @middleware.dup if @middleware
|
180
180
|
conn_opts[:proxy] = @proxy if @proxy
|
181
181
|
if conn_opts[:ssl].nil?
|
182
182
|
conn_opts[:ssl] = { :verify_mode => @ssl_verify_mode } if @ssl_verify_mode
|
data/lib/octokit/error.rb
CHANGED
@@ -106,6 +106,8 @@ module Octokit
|
|
106
106
|
def self.error_for_422(body)
|
107
107
|
if body =~ /PullRequestReviewComment/i && body =~ /(commit_id|end_commit_oid) is not part of the pull request/i
|
108
108
|
Octokit::CommitIsNotPartOfPullRequest
|
109
|
+
elsif body =~ /Path diff too large/i
|
110
|
+
Octokit::PathDiffTooLarge
|
109
111
|
else
|
110
112
|
Octokit::UnprocessableEntity
|
111
113
|
end
|
@@ -314,6 +316,10 @@ module Octokit
|
|
314
316
|
# and body matches 'PullRequestReviewComment' and 'commit_id (or end_commit_oid) is not part of the pull request'
|
315
317
|
class CommitIsNotPartOfPullRequest < UnprocessableEntity; end
|
316
318
|
|
319
|
+
# Raised when GitHub returns a 422 HTTP status code and body matches 'Path diff too large'.
|
320
|
+
# It could occur when attempting to post review comments on a "too large" file.
|
321
|
+
class PathDiffTooLarge < UnprocessableEntity; end
|
322
|
+
|
317
323
|
# Raised when GitHub returns a 451 HTTP status code
|
318
324
|
class UnavailableForLegalReasons < ClientError; end
|
319
325
|
|
@@ -86,7 +86,10 @@ module Octokit
|
|
86
86
|
original_url = env[:url]
|
87
87
|
env[:url] += safe_escape(response["location"])
|
88
88
|
unless same_host?(original_url, env[:url])
|
89
|
-
|
89
|
+
# HACK: Faraday’s Authorization middlewares don’t touch the request if the `Authorization` header is set.
|
90
|
+
# This is a workaround to drop authentication info.
|
91
|
+
# See https://github.com/octokit/octokit.rb/pull/1359#issuecomment-925609697
|
92
|
+
env[:request_headers]["Authorization"] = "dummy"
|
90
93
|
end
|
91
94
|
|
92
95
|
if convert_to_get?(response)
|
data/lib/octokit/preview.rb
CHANGED
@@ -6,7 +6,6 @@ module Octokit
|
|
6
6
|
PREVIEW_TYPES = {
|
7
7
|
:applications_api => 'application/vnd.github.doctor-strange-preview+json'.freeze,
|
8
8
|
:branch_protection => 'application/vnd.github.luke-cage-preview+json'.freeze,
|
9
|
-
:checks => 'application/vnd.github.antiope-preview+json'.freeze,
|
10
9
|
:commit_search => 'application/vnd.github.cloak-preview+json'.freeze,
|
11
10
|
:commit_pulls => 'application/vnd.github.groot-preview+json'.freeze,
|
12
11
|
:commit_branches => 'application/vnd.github.groot-preview+json'.freeze,
|
@@ -23,9 +22,7 @@ module Octokit
|
|
23
22
|
:topics => 'application/vnd.github.mercy-preview+json'.freeze,
|
24
23
|
:community_profile => 'application/vnd.github.black-panther-preview+json'.freeze,
|
25
24
|
:strict_validation => 'application/vnd.github.speedy-preview+json'.freeze,
|
26
|
-
:drafts => 'application/vnd.github.shadow-cat-preview'.freeze,
|
27
25
|
:template_repositories => 'application/vnd.github.baptiste-preview+json'.freeze,
|
28
|
-
:uninstall_github_app => 'application/vnd.github.gambit-preview+json'.freeze,
|
29
26
|
:project_card_events => 'application/vnd.github.starfox-preview+json'.freeze,
|
30
27
|
:vulnerability_alerts => 'application/vnd.github.dorian-preview+json'.freeze,
|
31
28
|
}
|
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.
|
4
|
+
version: 4.22.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:
|
13
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: 1.3.5
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.1.2
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: Ruby toolkit for working with the GitHub API
|