github

package
v0.269.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github is muster's small GitHub REST client: the repository and pull-request shapes, the pull-request listing the GitHub App reads with an installation token (internal/githubapp), and the API base both follow.

⚠ IT HELD THE PER-USER OAUTH CONNECTION TOO — the encrypted token store, the OAuth web flow and the token-based listings the Repos tab used. All of that was removed with the Repos tab: the GitHub App is muster's GitHub identity. The `github_connection` table that store wrote is dropped by migration 0059.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIBaseURL

func APIBaseURL() string

APIBaseURL is the API base every GitHub call uses (UseAPIBaseURL's value), so another client (internal/githubapp) follows the same override.

func UseAPIBaseURL

func UseAPIBaseURL(u string)

UseAPIBaseURL points every GitHub call at another API base. Only the e2eterm browser-test build calls it (its fake GitHub); a deployable binary never does.

func ValidRepoName added in v0.108.0

func ValidRepoName(s string) bool

ValidRepoName reports whether s is a GitHub owner/name. It is THE shape check for a repository muster is told about by name: a task's repository (internal/api connectedRepo) and an officer's configured repository (internal/officers Parse) ask it, so the two cannot accept different shapes.

Types

type PullRequest

type PullRequest struct {
	Number    int    `json:"number"`
	Title     string `json:"title"`
	State     string `json:"state"`
	HTMLURL   string `json:"html_url"`
	User      string `json:"user"`
	HeadRef   string `json:"head_ref"`
	BaseRef   string `json:"base_ref"`
	Draft     bool   `json:"draft"`
	UpdatedAt string `json:"updated_at"`
}

PullRequest is a repository pull request, flattened for the worker tool. The GitHub API nests author/branch under user/head/base; ListPullRequestsAt maps those into the flat fields below.

func ListPullRequestsAt

func ListPullRequestsAt(ctx context.Context, base, token, repo, state string) ([]PullRequest, error)

ListPullRequestsAt returns a repo's pull requests from the API at base (newest-updated first, up to 50). repo is "owner/name". state is one of "open", "closed", "all"; an empty or unrecognized value defaults to "open". The token stays server-side — it is never returned to the caller.

type Repo

type Repo struct {
	FullName string `json:"full_name"`
	Private  bool   `json:"private"`
	HTMLURL  string `json:"html_url"`
	CloneURL string `json:"clone_url"`
}

Repo is a repository as listed for the dispatch dialog's repository picker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL