Module: Octokit::Client::ActionsArtifacts
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/actions_artifacts.rb
Overview
Methods for the Actions Artifacts API
Instance Method Summary collapse
-
#artifact(repo, id, options = {}) ⇒ Sawyer::Resource
Get an artifact.
-
#artifact_download_url(repo, id, options = {}) ⇒ String
Get a download URL for an artifact.
-
#delete_artifact(repo, id, options = {}) ⇒ Boolean
Delete an artifact.
-
#repository_artifacts(repo, options = {}) ⇒ Sawyer::Resource
List all artifacts for a repository.
-
#workflow_run_artifacts(repo, workflow_run_id, options = {}) ⇒ Sawyer::Resource
List all artifacts for a workflow run.
Instance Method Details
#artifact(repo, id, options = {}) ⇒ Sawyer::Resource
Get an artifact
41 42 43 |
# File 'lib/octokit/client/actions_artifacts.rb', line 41 def artifact(repo, id, = {}) get "#{Repository.path repo}/actions/artifacts/#{id}", end |
#artifact_download_url(repo, id, options = {}) ⇒ String
Get a download URL for an artifact
52 53 54 55 56 57 |
# File 'lib/octokit/client/actions_artifacts.rb', line 52 def artifact_download_url(repo, id, = {}) url = "#{Repository.path repo}/actions/artifacts/#{id}/zip" response = client_without_redirects.head(url, ) response.headers['Location'] end |
#delete_artifact(repo, id, options = {}) ⇒ Boolean
Delete an artifact
66 67 68 |
# File 'lib/octokit/client/actions_artifacts.rb', line 66 def delete_artifact(repo, id, = {}) boolean_from_response :delete, "#{Repository.path repo}/actions/artifacts/#{id}", end |
#repository_artifacts(repo, options = {}) ⇒ Sawyer::Resource
List all artifacts for a repository
15 16 17 18 19 |
# File 'lib/octokit/client/actions_artifacts.rb', line 15 def repository_artifacts(repo, = {}) paginate "#{Repository.path repo}/actions/artifacts", do |data, last_response| data.artifacts.concat last_response.data.artifacts end end |
#workflow_run_artifacts(repo, workflow_run_id, options = {}) ⇒ Sawyer::Resource
List all artifacts for a workflow run
28 29 30 31 32 |
# File 'lib/octokit/client/actions_artifacts.rb', line 28 def workflow_run_artifacts(repo, workflow_run_id, = {}) paginate "#{Repository.path repo}/actions/runs/#{workflow_run_id}/artifacts", do |data, last_response| data.artifacts.concat last_response.data.artifacts end end |