octokit 5.2.0 → 5.5.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 +2 -2
- data/lib/octokit/client/organizations.rb +41 -0
- data/lib/octokit/client/projects.rb +1 -1
- data/lib/octokit/client/pull_requests.rb +11 -0
- 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: b6280e7e05d9920d645066464954aa69a1e377ebfb78b986ac52901bbff9e813
|
4
|
+
data.tar.gz: e522bd69cedcb36c8cedfb3c52255fe0b24c68f824c3a490f832928946d067ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 774496ed5e239da2e09f1eb2f925f171d671797adcbee9cae53d886b0d8c9a5fa20428cfb81eccdfb04b54c2d3b48385008aa5eb00356b565ba7795114bd5e54
|
7
|
+
data.tar.gz: 467d57fe3f69686ae24d4bd3eca6e9e87d68c2b1854f44c950ec1b309020748577af2e8c4f368ba27606bed827ac114673835a209ae085b6257cd5ba782b8124
|
data/README.md
CHANGED
@@ -79,7 +79,7 @@ Install via Rubygems
|
|
79
79
|
|
80
80
|
... or add to your Gemfile
|
81
81
|
|
82
|
-
gem "octokit", "~>
|
82
|
+
gem "octokit", "~> 5.0"
|
83
83
|
|
84
84
|
Access the library in Ruby:
|
85
85
|
|
@@ -664,7 +664,7 @@ Once configured, the middleware will store responses in cache based on ETag
|
|
664
664
|
fingerprint and serve those back up for future `304` responses for the same
|
665
665
|
resource. See the [project README][cache] for advanced usage.
|
666
666
|
|
667
|
-
[cache]: https://github.com/
|
667
|
+
[cache]: https://github.com/sourcelevel/faraday-http-cache
|
668
668
|
[faraday]: https://github.com/lostisland/faraday
|
669
669
|
|
670
670
|
## Hacking on Octokit.rb
|
@@ -335,6 +335,27 @@ module Octokit
|
|
335
335
|
get "#{Organization.path(org)}/teams/#{team_slug}", options
|
336
336
|
end
|
337
337
|
|
338
|
+
# Check team permissions for a repository
|
339
|
+
#
|
340
|
+
# Requires authenticated organization member.
|
341
|
+
#
|
342
|
+
# @param org [String, Integer] Organization GitHub login or id.
|
343
|
+
# @param team_slug_or_id [String, Integer] Team slug or Team ID.
|
344
|
+
# @param owner [String] Owner name for the repository.
|
345
|
+
# @param repo [String] Name of the repo to check permissions against.
|
346
|
+
# @return [String, Sawyer::Resource] Depending on options it may be an empty string or a resource.
|
347
|
+
# @example
|
348
|
+
# # Check whether the team has any permissions with the repository
|
349
|
+
# @client.team_permissions_for_repo("github", "justice-league", "octocat", "hello-world")
|
350
|
+
#
|
351
|
+
# @example
|
352
|
+
# # Get the full repository object including the permissions level and role for the team
|
353
|
+
# @client.team_permissions_for_repo("github", "justice-league", "octocat", "hello-world", :accept => 'application/vnd.github.v3.repository+json')
|
354
|
+
# @see https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository
|
355
|
+
def team_permissions_for_repo(org, team_slug_or_id, owner, repo, options = {})
|
356
|
+
get "#{Organization.path(org)}/teams/#{team_slug_or_id}/repos/#{owner}/#{repo}", options
|
357
|
+
end
|
358
|
+
|
338
359
|
# List child teams
|
339
360
|
#
|
340
361
|
# Requires authenticated organization member.
|
@@ -802,6 +823,26 @@ module Octokit
|
|
802
823
|
def billing_actions(org)
|
803
824
|
get "#{Organization.path(org)}/settings/billing/actions"
|
804
825
|
end
|
826
|
+
|
827
|
+
# Get organization audit log.
|
828
|
+
#
|
829
|
+
# Gets the audit log for an organization.
|
830
|
+
#
|
831
|
+
# @param org [String, Integer] Organization GitHub login or id for which
|
832
|
+
# to retrieve the audit log.
|
833
|
+
# @option options [String] :include ('all') Filter by event type.
|
834
|
+
# `all`, `git` or `web`.
|
835
|
+
# @option options [String] :phrase A search phrase.
|
836
|
+
# @option options [String] :order ('desc') The order of audit log events. To list newest events first, specify desc.
|
837
|
+
# To list oldest events first, specify asc.
|
838
|
+
#
|
839
|
+
# @return [Array<Sawyer::Resource>] List of events
|
840
|
+
# @see https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization
|
841
|
+
# @example
|
842
|
+
# Octokit.organization_audit_log('github', {include: 'all', phrase: 'action:org.add_member created:>2022-08-29 user:octocat'})
|
843
|
+
def organization_audit_log(org, options = {})
|
844
|
+
paginate "#{Organization.path org}/audit-log", options
|
845
|
+
end
|
805
846
|
end
|
806
847
|
end
|
807
848
|
end
|
@@ -276,6 +276,17 @@ module Octokit
|
|
276
276
|
end
|
277
277
|
alias pull_files pull_request_files
|
278
278
|
|
279
|
+
# Update a pull request branch
|
280
|
+
#
|
281
|
+
# @see https://developer.github.com/v3/pulls/#update-a-pull-request-branch
|
282
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
283
|
+
# @param number [Integer] Number of pull request
|
284
|
+
# @param options [Hash] Optional parameters (e.g. expected_head_sha)
|
285
|
+
# @return [Boolean] True if the pull request branch has been updated
|
286
|
+
def update_pull_request_branch(repo, number, options = {})
|
287
|
+
boolean_from_response(:put, "#{Repository.path repo}/pulls/#{number}/update-branch", options)
|
288
|
+
end
|
289
|
+
|
279
290
|
# Merge a pull request
|
280
291
|
#
|
281
292
|
# @see https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
|
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: 5.
|
4
|
+
version: 5.5.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: 2022-
|
13
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: 1.3.5
|
184
184
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
185
|
+
rubygems_version: 3.3.7
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Ruby toolkit for working with the GitHub API
|