Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 1.09 KB

File metadata and controls

67 lines (52 loc) · 1.09 KB

Common Workflows

The generated surface is large, but a few namespaces cover most day-to-day GitHub automation.

Authenticated User

{:ok, me} = GitHubEx.Users.get_authenticated(client)

Repositories

{:ok, repos} =
  GitHubEx.Repos.list_for_authenticated_user(client, %{
    "visibility" => "all",
    "sort" => "updated"
  })

Single repository:

{:ok, repo} =
  GitHubEx.Repos.get(client, %{
    "owner" => "octocat",
    "repo" => "Hello-World"
  })

Issues

{:ok, issues} =
  GitHubEx.Issues.list_for_repo(client, %{
    "owner" => "octocat",
    "repo" => "Hello-World",
    "state" => "open"
  })

Pull Requests

{:ok, pulls} =
  GitHubEx.Pulls.list(client, %{
    "owner" => "octocat",
    "repo" => "Hello-World"
  })

Workflow Runs

{:ok, runs} =
  GitHubEx.Actions.list_workflow_runs_for_repo(client, %{
    "owner" => "octocat",
    "repo" => "Hello-World",
    "per_page" => 25
  })

Search

Search endpoints usually return items arrays and benefit from GitHubEx.Pagination with item_key: "items".