GitOps.GitHub (Git Ops v2.11.3)

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}}

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.

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)

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()}

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.