Documentation ¶
Index ¶
- Constants
- Variables
- func RunningOnCodespaces() bool
- type ApiCallOptions
- type AuthStatus
- type Cli
- func (cli *Cli) ApiCall(ctx context.Context, hostname, path string, options ApiCallOptions) (string, error)
- func (cli *Cli) BinaryPath() string
- func (cli *Cli) CheckInstalled(ctx context.Context) error
- func (cli *Cli) CreatePrivateRepository(ctx context.Context, name string) error
- func (cli *Cli) DeleteSecret(ctx context.Context, repoSlug string, name string) error
- func (cli *Cli) DeleteVariable(ctx context.Context, repoSlug string, name string) error
- func (cli *Cli) GetAuthStatus(ctx context.Context, hostname string) (AuthStatus, error)
- func (cli *Cli) GetGitProtocolType(ctx context.Context) (string, error)
- func (cli *Cli) GitHubActionsExists(ctx context.Context, repoSlug string) (bool, error)
- func (cli *Cli) InstallUrl() string
- func (cli *Cli) ListRepositories(ctx context.Context) ([]GhCliRepository, error)
- func (cli *Cli) ListSecrets(ctx context.Context, repoSlug string) ([]string, error)
- func (cli *Cli) ListVariables(ctx context.Context, repoSlug string) ([]string, error)
- func (cli *Cli) Login(ctx context.Context, hostname string) error
- func (cli *Cli) Name() string
- func (cli *Cli) SetSecret(ctx context.Context, repoSlug string, name string, value string) error
- func (cli *Cli) SetVariable(ctx context.Context, repoSlug string, name string, value string) error
- func (cli *Cli) ViewRepository(ctx context.Context, name string) (GhCliRepository, error)
- type GhCliRepository
- type GitHubActionsResponse
Constants ¶
View Source
const ( GitSshProtocolType = "ssh" GitHttpsProtocolType = "https" )
Variables ¶
View Source
var ( ErrGitHubCliNotLoggedIn = errors.New("gh cli is not logged in") ErrUserNotAuthorized = errors.New("user is not authorized. " + "Try running gh auth refresh with the required scopes to request additional authorization") ErrRepositoryNameInUse = errors.New("repository name already in use") // The hostname of the public GitHub service. GitHubHostName = "github.com" // Environment variable that gh cli uses for auth token overrides TokenEnvVars = []string{"GITHUB_TOKEN", "GH_TOKEN"} )
View Source
var Version semver.Version = semver.MustParse("2.55.0")
Version is the minimum version of GitHub cli that we require (and the one we fetch when we fetch gh on behalf of a user).
Functions ¶
func RunningOnCodespaces ¶
func RunningOnCodespaces() bool
RunningOnCodespaces check if the application is running on codespaces.
Types ¶
type ApiCallOptions ¶
type ApiCallOptions struct {
Headers []string
}
ApiCallOptions represent the options for the ApiCall method.
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
func NewGitHubCli ¶
func (*Cli) ApiCall ¶
func (cli *Cli) ApiCall(ctx context.Context, hostname, path string, options ApiCallOptions) (string, error)
ApiCall uses gh cli to call https://api.<hostname>/<path>.
func (*Cli) BinaryPath ¶
func (*Cli) CreatePrivateRepository ¶
func (*Cli) DeleteSecret ¶
func (*Cli) DeleteVariable ¶
func (*Cli) GetAuthStatus ¶
func (*Cli) GetGitProtocolType ¶
func (*Cli) GitHubActionsExists ¶
GitHubActionsExists gets the information from upstream about the workflows and return true if there is at least one workflow in the repo.
func (*Cli) InstallUrl ¶
func (*Cli) ListRepositories ¶
func (cli *Cli) ListRepositories(ctx context.Context) ([]GhCliRepository, error)
func (*Cli) ListSecrets ¶
func (*Cli) ListVariables ¶
func (*Cli) SetVariable ¶
func (*Cli) ViewRepository ¶
type GhCliRepository ¶
type GitHubActionsResponse ¶
type GitHubActionsResponse struct {
TotalCount int `json:"total_count"`
}
Click to show internal directories.
Click to hide internal directories.