Documentation ¶
Index ¶
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 GitHubCliVersion semver.Version = semver.MustParse("2.28.0")
GitHubCliVersion is the minimum version of GitHub cli that we require (and the one we fetch when we fetch bicep on behalf of a user).
Functions ¶
func RunningOnCodespaces ¶
func RunningOnCodespaces() bool
RunningOnCodespaces check if the application is running on codespaces.
Types ¶
type GhCliRepository ¶
type GitHubActionsResponse ¶
type GitHubActionsResponse struct {
TotalCount int `json:"total_count"`
}
type GitHubCli ¶
type GitHubCli interface { tools.ExternalTool GetAuthStatus(ctx context.Context, hostname string) (AuthStatus, error) ListSecrets(ctx context.Context, repo string) ([]string, error) ListVariables(ctx context.Context, repo string) ([]string, error) SetSecret(ctx context.Context, repo string, name string, value string) error DeleteSecret(ctx context.Context, repo string, name string) error SetVariable(ctx context.Context, repoSlug string, name string, value string) error DeleteVariable(ctx context.Context, repoSlug string, name string) error Login(ctx context.Context, hostname string) error ListRepositories(ctx context.Context) ([]GhCliRepository, error) ViewRepository(ctx context.Context, name string) (GhCliRepository, error) CreatePrivateRepository(ctx context.Context, name string) error GetGitProtocolType(ctx context.Context) (string, error) GitHubActionsExists(ctx context.Context, repoSlug string) (bool, error) BinaryPath() string }
func NewGitHubCli ¶
Click to show internal directories.
Click to hide internal directories.