GitOps.GitHub (Git Ops v2.12.0)

View Source

GitHub API integration for looking up user information.

Summary

Functions

Batch find GitHub users by their email addresses. Returns a map of %{email => {:ok, user_info} | {:error, reason}}

Close the open pull request numbered number, commenting comment on it first when one is given.

Create a GitHub release for an existing tag, returning its URL.

Find a GitHub user by their email address. Returns {:ok, user} if found, where user contains :username, :id, and :url. Returns {:error, reason} if not found or if there's an error.

The number of the open pull request for branch, or nil when there is none.

Create or update the open pull request for branch, returning its URL.

Functions

batch_find_users_by_emails(emails)

Batch find GitHub users by their email addresses. Returns a map of %{email => {:ok, user_info} | {:error, reason}}

batch_pull_requests_from_commits(hashes)

close_pull_request(number, comment \\ nil)

@spec close_pull_request(pos_integer(), String.t() | nil) ::
  {:ok, String.t()} | {:error, String.t()}

Close the open pull request numbered number, commenting comment on it first when one is given.

create_release(tag, name, notes)

@spec create_release(String.t(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, String.t()}

Create a GitHub release for an existing tag, returning its URL.

fetch_user_from_api(email)

Find a GitHub user by their email address. Returns {:ok, user} if found, where user contains :username, :id, and :url. Returns {:error, reason} if not found or if there's an error.

get_pull_request_from_commit(hash)

@spec get_pull_request_from_commit(String.t()) ::
  {:ok, %{number: integer(), url: String.t()} | nil} | {:error, String.t()}

open_pull_request_number(branch)

@spec open_pull_request_number(String.t()) ::
  {:ok, pos_integer() | nil} | {:error, String.t()}

The number of the open pull request for branch, or nil when there is none.

upsert_pull_request(branch, base, title, body, labels \\ [])

@spec upsert_pull_request(String.t(), String.t(), String.t(), String.t(), [String.t()]) ::
  {:ok, String.t()} | {:error, String.t()}

Create or update the open pull request for branch, returning its URL.

labels are applied when the pull request is first created.