View Source Tentacat.Repositories.Branches (Tentacat v2.4.0)

Summary

Functions

Link to this function

find(client \\ %Client{}, owner, repo, branch)

View Source

Get Branch.

Example

Tentacat.Repositories.Branches.find "elixir-lang", "elixir", "feature"
Tentacat.Repositories.Branches.find client, "elixir-lang", "elixir", "feature"

More info at: https://developer.github.com/v3/repos/#get-branch

Link to this function

list(client \\ %Client{}, owner, repo)

View Source

List Branches.

Example

Tentacat.Repositories.Branches.list "elixir-lang", "elixir"
Tentacat.Repositories.Branches.list client, "elixir-lang", "elixir"

More info at: https://developer.github.com/v3/repos/#list-branches

Link to this function

update_protection(client \\ %Client{}, owner, repo, branch, body)

View Source
@spec update_protection(Tentacat.Client.t(), binary(), binary(), binary(), map()) ::
  Tentacat.response()

Update Branch Protection.

Create body example:

%{
  "required_status_checks" => %{
    "strict" => true,
    "contexts" => [
      "continuous-integration/travis-ci"
    ]
  },
  "enforce_admins" => true,
  "required_pull_request_reviews" => %{
    "dismissal_restrictions" => %{
      "users" => [
        "octocat"
      ],
      "teams" => [
        "justice-league"
      ]
    },
    "dismiss_stale_reviews" => true,
    "require_code_owner_reviews" => true,
    "required_approving_review_count" => 2
  },
  "restrictions" => %{
    "users" => [
      "octocat"
    ],
    "teams" => [
      "justice-league"
    ]
  }
}

Example

Tentacat.Repositories.Branches.update_protection "elixir-lang", "elixir", "feature", body
Tentacat.Repositories.Branches.update_protection client, "elixir-lang", "elixir", "feature", body

More info at: https://developer.github.com/v3/repos/branches/#update-branch-protection