octokit 5.5.0 → 5.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6280e7e05d9920d645066464954aa69a1e377ebfb78b986ac52901bbff9e813
4
- data.tar.gz: e522bd69cedcb36c8cedfb3c52255fe0b24c68f824c3a490f832928946d067ed
3
+ metadata.gz: bbf0b3ef2f8550628d4bde2fa55f7bcb97261364e94aac9f5a149ce6e86fa019
4
+ data.tar.gz: d336c02e28efb73618c1c24827b2b7703dc5341ce95087467089cf36f11d96fb
5
5
  SHA512:
6
- metadata.gz: 774496ed5e239da2e09f1eb2f925f171d671797adcbee9cae53d886b0d8c9a5fa20428cfb81eccdfb04b54c2d3b48385008aa5eb00356b565ba7795114bd5e54
7
- data.tar.gz: 467d57fe3f69686ae24d4bd3eca6e9e87d68c2b1854f44c950ec1b309020748577af2e8c4f368ba27606bed827ac114673835a209ae085b6257cd5ba782b8124
6
+ metadata.gz: 960aacdc0e1a37794e6bed1a0c5f2686c1dca5160c0802cb449590f92ecab4cf243a0201b65e419fe3ffa38c194f106eceed0d46c90f63ceeb8a4aa14b22d716
7
+ data.tar.gz: 22a81c032d49f11c2f3875bfbc1c577449787d0899f20d0108dc7de868a2b5f1c86163ccebf46eb4a4b2567277c46fd83aca619c071a238746229664894008bf
@@ -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/artifacts#download-an-artifact
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
@@ -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
data/lib/octokit/error.rb CHANGED
@@ -77,7 +77,7 @@ module Octokit
77
77
  Octokit::TooManyRequests
78
78
  when /login attempts exceeded/i
79
79
  Octokit::TooManyLoginAttempts
80
- when /returns blobs up to [0-9]+ MB/i
80
+ when /(returns|for) blobs (up to|between) [0-9\-]+ MB/i
81
81
  Octokit::TooLargeContent
82
82
  when /abuse/i
83
83
  Octokit::AbuseDetected
@@ -7,11 +7,11 @@ module Octokit
7
7
 
8
8
  # Current minor release.
9
9
  # @return [Integer]
10
- MINOR = 5
10
+ MINOR = 6
11
11
 
12
12
  # Current patch level.
13
13
  # @return [Integer]
14
- PATCH = 0
14
+ PATCH = 1
15
15
 
16
16
  # Full release version.
17
17
  # @return [String]
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.5.0
4
+ version: 5.6.1
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-09-12 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