Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AddRepoSecret(secretKey, secretValue string) error
- func (c *Client) AddWebhook(webhookConfig *git.WebhookConfig) error
- func (c *Client) AddWorkflow(workflow *Workflow, branch string) error
- func (c *Client) BuildCommitTree(ref *github.Reference, commitInfo *git.CommitInfo, checkChange bool) (*github.Tree, error)
- func (c *Client) CreateFile(content []byte, filePath, targetBranch string) error
- func (c *Client) CreateRepo(org, defaultBranch string) error
- func (c *Client) DeleteBranch(branch string) error
- func (c *Client) DeleteFiles(commitInfo *git.CommitInfo) error
- func (c *Client) DeleteRepo() error
- func (c *Client) DeleteRepoSecret(secretKey string) error
- func (c *Client) DeleteWebhook(webhookConfig *git.WebhookConfig) error
- func (c *Client) DeleteWorkflow(workflow *Workflow, branch string) error
- func (c *Client) DescribeRepo() (*git.RepoInfo, error)
- func (c *Client) DownloadAsset(tagName, assetName, fileName string) error
- func (c *Client) DownloadRepo() (string, error)
- func (c *Client) FetchRemoteContent(wsFiles []string) ([]string, map[string]error, error)
- func (c *Client) GetLastCommit() (*github.RepositoryCommit, error)
- func (c *Client) GetLatestReleaseTagName() (string, error)
- func (c *Client) GetPathInfo(location string) ([]*git.RepoFileStatus, error)
- func (c *Client) GetWorkflowPath() (string, error)
- func (c *Client) InitRepo() error
- func (c *Client) MergeCommits(commitInfo *git.CommitInfo) error
- func (c *Client) MergePullRequest(number int, mergeMethod MergeMethod) error
- func (c *Client) NewBranch(newBranch string) (*github.Reference, error)
- func (c *Client) NewPullRequest(commitInfo *git.CommitInfo) (int, error)
- func (c *Client) ProtectBranch(branch string) error
- func (c *Client) PushFiles(commitInfo *git.CommitInfo, checkChange bool) (bool, error)
- func (c *Client) PushLocalPath(ref *github.Reference, tree *github.Tree, commitInfo *git.CommitInfo) error
- func (c *Client) RepoSecretExists(secretKey string) (bool, error)
- func (c *Client) VerifyWorkflows(workflows []*Workflow) (map[string]error, error)
- type MergeMethod
- type Workflow
Constants ¶
const (
TokenEnvKey = "GITHUB_TOKEN"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) AddRepoSecret ¶
AddRepoSecret adds a secret to a GitHub repo.
func (*Client) AddWebhook ¶
func (c *Client) AddWebhook(webhookConfig *git.WebhookConfig) error
func (*Client) BuildCommitTree ¶
func (*Client) CreateFile ¶
func (*Client) CreateRepo ¶
func (*Client) DeleteBranch ¶
func (*Client) DeleteFiles ¶
func (c *Client) DeleteFiles(commitInfo *git.CommitInfo) error
func (*Client) DeleteRepo ¶
func (*Client) DeleteRepoSecret ¶
DeleteRepoSecret deletes a secret in a GitHub repo.
func (*Client) DeleteWebhook ¶
func (c *Client) DeleteWebhook(webhookConfig *git.WebhookConfig) error
func (*Client) DeleteWorkflow ¶
func (*Client) DownloadAsset ¶
func (*Client) DownloadRepo ¶ added in v0.10.0
DownloadRepo will download repo, return repo local path and error
func (*Client) FetchRemoteContent ¶
func (*Client) GetLastCommit ¶
func (c *Client) GetLastCommit() (*github.RepositoryCommit, error)
func (*Client) GetLatestReleaseTagName ¶
func (*Client) GetPathInfo ¶ added in v0.10.0
func (c *Client) GetPathInfo(location string) ([]*git.RepoFileStatus, error)
func (*Client) GetWorkflowPath ¶
func (*Client) MergeCommits ¶
func (c *Client) MergeCommits(commitInfo *git.CommitInfo) error
func (*Client) MergePullRequest ¶
func (c *Client) MergePullRequest(number int, mergeMethod MergeMethod) error
func (*Client) NewPullRequest ¶
func (c *Client) NewPullRequest(commitInfo *git.CommitInfo) (int, error)
func (*Client) ProtectBranch ¶
ProtectBranch will protect the special branch
func (*Client) PushFiles ¶ added in v0.10.0
PushFiles will push local change to remote repo return boolean value is for control whether to roll out if encounter error
func (*Client) PushLocalPath ¶
func (*Client) RepoSecretExists ¶
RepoSecretExists detects if a secret exists in a GitHub repo.
func (*Client) VerifyWorkflows ¶
VerifyWorkflows get the workflows with names "wf1.yml", "wf2.yml", then: If all workflows is ok => return ({"wf1.yml":nil, "wf2.yml:nil}, nil) If some error occurred => return (nil, error) If wf1.yml is not found => return ({"wf1.yml":error("not found"), "wf2.yml:nil},nil)
type MergeMethod ¶
type MergeMethod string
const ( MergeMethodSquash MergeMethod = "squash" MergeMethodMerge MergeMethod = "merge" MergeMethodRebase MergeMethod = "rebase" )