octokit 5.5.0 → 5.6.0

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: 142651c8cb905616f9b98ef7d87db6e56a729a6ee87cf423f347c6be549d356a
4
+ data.tar.gz: d647f6470d7c7c21d9dc589018a181225a51fe45913cb323704d9ddb01cecd1f
5
5
  SHA512:
6
- metadata.gz: 774496ed5e239da2e09f1eb2f925f171d671797adcbee9cae53d886b0d8c9a5fa20428cfb81eccdfb04b54c2d3b48385008aa5eb00356b565ba7795114bd5e54
7
- data.tar.gz: 467d57fe3f69686ae24d4bd3eca6e9e87d68c2b1854f44c950ec1b309020748577af2e8c4f368ba27606bed827ac114673835a209ae085b6257cd5ba782b8124
6
+ metadata.gz: a674820129345b669b42d31934f195caeb453344907a4c95a5b11819466c3aba01dc37889e0371703dd0211747ab919b8a60858be0fa4cac7b39df261de42bd7
7
+ data.tar.gz: 7f2b1d6165badfe0094c0fffc3b2c176656a0fa11063dafef707595e749d99350cd692910e4f6d4829227bdd0e505452f8713b8e8bab524dcc94a9989af1f89b
@@ -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
@@ -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 = 5
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.5.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-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