Module: Octokit::Client::ActionsArtifacts
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/actions_artifacts.rb |
Overview
Methods for the Actions Artifacts API
Instance Method Summary
-
#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
# 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
# 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
# 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
# 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
# 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