octokit 5.4.0 → 5.6.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: bb3c4ab224890bb19194fb2c7af88c0e89be709e12b9a7df13df4d3aa7cac1dc
4
- data.tar.gz: 79a40c2fea62d7898e7906a3119bf5049c51baeb128dfa88722301682b691204
3
+ metadata.gz: 142651c8cb905616f9b98ef7d87db6e56a729a6ee87cf423f347c6be549d356a
4
+ data.tar.gz: d647f6470d7c7c21d9dc589018a181225a51fe45913cb323704d9ddb01cecd1f
5
5
  SHA512:
6
- metadata.gz: 6b6a080f40b9c52cb1450d13f5d64d0dbc8f8e27e699b585d0e9e1a3e29eb1a0b19eec29ca6ef25726b1c113f0c088a530762eabc297eb2a47ca77dedc71444c
7
- data.tar.gz: ea44cdd3350cf3206dee44ca90f3fa3f3776d1be078fdaa77b64c99b3e3d1e9d7d7d6800f95cd4cfa076a0e171f8e7e7d689066ff551d2d8d5a63cb1efaff56c
6
+ metadata.gz: a674820129345b669b42d31934f195caeb453344907a4c95a5b11819466c3aba01dc37889e0371703dd0211747ab919b8a60858be0fa4cac7b39df261de42bd7
7
+ data.tar.gz: 7f2b1d6165badfe0094c0fffc3b2c176656a0fa11063dafef707595e749d99350cd692910e4f6d4829227bdd0e505452f8713b8e8bab524dcc94a9989af1f89b
data/README.md CHANGED
@@ -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/plataformatec/faraday-http-cache
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
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Octokit
4
+ class Client
5
+ # Methods for the Actions Artifacts API
6
+ #
7
+ # @see https://developer.github.com/v3/actions/artifacts
8
+ module ActionsArtifacts
9
+ # List all artifacts for a repository
10
+ #
11
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
12
+ #
13
+ # @return [Sawyer::Resource] the total count and an array of artifacts
14
+ # @see https://developer.github.com/v3/actions/artifacts#list-artifacts-for-a-repository
15
+ def repository_artifacts(repo, options = {})
16
+ paginate "#{Repository.path repo}/actions/artifacts", options
17
+ end
18
+
19
+ # List all artifacts for a workflow run
20
+ #
21
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
22
+ # @param workflow_run_id [Integer] Id of a workflow run
23
+ #
24
+ # @return [Sawyer::Resource] the total count and an array of artifacts
25
+ # @see https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts
26
+ def workflow_run_artifacts(repo, workflow_run_id, options = {})
27
+ paginate "#{Repository.path repo}/actions/runs/#{workflow_run_id}/artifacts", options
28
+ end
29
+
30
+ # Get an artifact
31
+ #
32
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
33
+ # @param id [Integer] Id of an artifact
34
+ #
35
+ # @return [Sawyer::Resource] Artifact information
36
+ # @see https://docs.github.com/en/rest/actions/artifacts#get-an-artifact
37
+ def artifact(repo, id, options = {})
38
+ get "#{Repository.path repo}/actions/artifacts/#{id}", options
39
+ end
40
+
41
+ # Get a download URL for an artifact
42
+ #
43
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
44
+ # @param id [Integer] Id of an artifact
45
+ #
46
+ # @return [String] URL to the .zip archive of the artifact
47
+ # @see https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs
48
+ def artifact_download_url(repo, id, options = {})
49
+ url = "#{Repository.path repo}/actions/artifacts/#{id}/zip"
50
+
51
+ response = client_without_redirects.head(url, options)
52
+ response.headers['Location']
53
+ end
54
+
55
+ # Delete an artifact
56
+ #
57
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
58
+ # @param id [Integer] Id of an artifact
59
+ #
60
+ # @return [Boolean] Return true if the artifact was successfully deleted
61
+ # @see https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact
62
+ def delete_artifact(repo, id, options = {})
63
+ boolean_from_response :delete, "#{Repository.path repo}/actions/artifacts/#{id}", options
64
+ end
65
+ end
66
+ end
67
+ end
@@ -823,6 +823,26 @@ module Octokit
823
823
  def billing_actions(org)
824
824
  get "#{Organization.path(org)}/settings/billing/actions"
825
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
826
846
  end
827
847
  end
828
848
  end
@@ -4,7 +4,7 @@ module Octokit
4
4
  class Client
5
5
  # Methods for Projects API
6
6
  #
7
- # @see https://developer.github.com/v3/repos/projects
7
+ # @see https://docs.github.com/en/rest/projects
8
8
  module Projects
9
9
  # List projects for a repository
10
10
  #
@@ -11,6 +11,7 @@ require 'octokit/rate_limit'
11
11
  require 'octokit/repository'
12
12
  require 'octokit/user'
13
13
  require 'octokit/organization'
14
+ require 'octokit/client/actions_artifacts'
14
15
  require 'octokit/client/actions_secrets'
15
16
  require 'octokit/client/actions_workflows'
16
17
  require 'octokit/client/actions_workflow_jobs'
@@ -74,6 +75,7 @@ module Octokit
74
75
  include Octokit::Configurable
75
76
  include Octokit::Connection
76
77
  include Octokit::Warnable
78
+ include Octokit::Client::ActionsArtifacts
77
79
  include Octokit::Client::ActionsSecrets
78
80
  include Octokit::Client::Authorizations
79
81
  include Octokit::Client::Checks
@@ -7,7 +7,7 @@ module Octokit
7
7
 
8
8
  # Current minor release.
9
9
  # @return [Integer]
10
- MINOR = 4
10
+ MINOR = 6
11
11
 
12
12
  # Current patch level.
13
13
  # @return [Integer]
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.0
4
+ version: 5.6.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-08-30 00:00:00.000000000 Z
13
+ date: 2022-09-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -85,6 +85,7 @@ files:
85
85
  - lib/octokit/arguments.rb
86
86
  - lib/octokit/authentication.rb
87
87
  - lib/octokit/client.rb
88
+ - lib/octokit/client/actions_artifacts.rb
88
89
  - lib/octokit/client/actions_secrets.rb
89
90
  - lib/octokit/client/actions_workflow_jobs.rb
90
91
  - lib/octokit/client/actions_workflow_runs.rb