Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GitHub Actions #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions lib/tentacat/actions/artifacts.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
defmodule Tentacat.Actions.Artifacts do
import Tentacat
alias Tentacat.Client

@doc """
List the artifacts for a repository

## Example

Tentacat.Actions.Artifacts.list "elixir-lang" , "elixir"

More info at https://developer.github.com/v3/actions/artifacts/#list-artifacts-for-a-repository
"""
@spec list(Client.t(), binary, binary) :: Tentacat.response()
def list(client \\ %Client{}, owner, repo) do
get("repos/#{owner}/#{repo}/actions/artifacts", client)
end

@doc """
List artifacts for a specific workflow run

### Example

Tentacat.Actions.Artifacts.list "elixir-lang", "elixir", "345434"
More info at: https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts
"""
@spec list_for_run(Client.t(), binary, binary, binary | integer) :: Tentacat.response()
def list_for_run(client \\ %Client{}, owner, repo, run_id) do
get("repos/#{owner}/#{repo}/actions/runs/#{run_id}/artifacts", client)
end
end
18 changes: 18 additions & 0 deletions lib/tentacat/actions/workflow_runs.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule Tentacat.Actions.WorkflowRuns do
import Tentacat
alias Tentacat.Client

@doc """
List the workflow runs for a repository

## Example

Tentacat.Actions.WorkflowRuns.list(client, "some-user", "some-repo")

More info at https://developer.github.com/v3/actions/workflow-runs/#list-repository-workflow-runs
"""
@spec list(Client.t(), binary, binary) :: Tentacat.response()
def list(client \\ %Client{}, owner, repo) do
get("repos/#{owner}/#{repo}/actions/runs", client)
end
end