Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AddRepoSecret(secretKey, secretValue string) error
- func (c *Client) AddWorkflow(workflow *Workflow, branch string) error
- func (c *Client) CreateFile(content []byte, filePath, targetBranch string) error
- func (c *Client) CreateRepo() error
- func (c *Client) DeleteRepo() error
- func (c *Client) DeleteRepoSecret(secretKey string) error
- func (c *Client) DeleteWorkflow(workflow *Workflow, branch string) error
- func (c *Client) DownloadAsset(tagName, assetName string) error
- func (c *Client) DownloadLatestCodeAsZipFile() error
- func (c *Client) FetchRemoteContent(wsFiles []string) ([]string, map[string]error, error)
- func (c *Client) GetLastCommit() (*github.RepositoryCommit, error)
- func (c *Client) GetRepoDescription() (*github.Repository, error)
- func (c *Client) GetWorkflowPath() (string, error)
- func (c *Client) MergePullRequest(number int, mergeMethod MergeMethod) error
- func (c *Client) NewBranch(baseBranch, newBranch string) error
- func (c *Client) NewPullRequest(fromBranch, toBranch string) (int, error)
- func (c *Client) RepoSecretExists(secretKey string) (bool, error)
- func (c *Client) VerifyWorkflows(workflows []*Workflow) (map[string]error, error)
- type MergeMethod
- type Option
- type Workflow
Constants ¶
View Source
const ( DefaultWorkPath = ".github-workpath" // https://github.com/merico-dev/dtm-scaffolding-golang/archive/refs/heads/main.zip -> 302 -> // https://codeload.github.com/merico-dev/dtm-scaffolding-golang/zip/refs/heads/main DefaultLatestCodeZipfileDownloadUrlFormat = "https://codeload.github.com/%s/%s/zip/refs/heads/main" DefaultLatestCodeZipfileName = "main-latest.zip" )
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) CreateFile ¶
func (*Client) CreateRepo ¶
func (*Client) DeleteRepo ¶ added in v0.3.0
func (*Client) DeleteRepoSecret ¶
DeleteRepoSecret deletes a secret in a GitHub repo.
func (*Client) DeleteWorkflow ¶
func (*Client) DownloadAsset ¶
func (*Client) DownloadLatestCodeAsZipFile ¶
func (*Client) FetchRemoteContent ¶ added in v0.3.0
func (*Client) GetLastCommit ¶ added in v0.2.0
func (c *Client) GetLastCommit() (*github.RepositoryCommit, error)
func (*Client) GetRepoDescription ¶ added in v0.2.0
func (c *Client) GetRepoDescription() (*github.Repository, error)
func (*Client) GetWorkflowPath ¶ added in v0.2.0
func (*Client) MergePullRequest ¶ added in v0.2.0
func (c *Client) MergePullRequest(number int, mergeMethod MergeMethod) error
func (*Client) NewPullRequest ¶ added in v0.2.0
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 ¶ added in v0.2.0
type MergeMethod string
const ( MergeMethodSquash MergeMethod = "squash" MergeMethodMerge MergeMethod = "merge" MergeMethodRebase MergeMethod = "rebase" )
Click to show internal directories.
Click to hide internal directories.