Documentation ¶
Index ¶
- Constants
- func NewGithub(scmCfg *v1alpha1.SCMSource) (scm.Provider, error)
- func ParseEvent(scmCfg *v1alpha1.SCMSource, request *http.Request) *scm.EventData
- type Github
- func (g *Github) CheckToken() error
- func (g *Github) CreateStatus(status c_v1alpha1.StatusPhase, targetURL, repoURL, commitSHA string) error
- func (g *Github) CreateWebhook(repo string, webhook *scm.Webhook) error
- func (g *Github) DeleteWebhook(repo string, webhookURL string) error
- func (g *Github) GetPullRequestSHA(repoURL string, number int) (string, error)
- func (g *Github) GetToken() (string, error)
- func (g *Github) GetWebhook(repo string, webhookURL string) (*github.Hook, error)
- func (g *Github) ListBranches(repo string) ([]string, error)
- func (g *Github) ListDockerfiles(repo string) ([]string, error)
- func (g *Github) ListRepos() ([]scm.Repository, error)
- func (g *Github) ListTags(repo string) ([]string, error)
Constants ¶
View Source
const (
// EventTypeHeader represents the header key for event type of Github.
EventTypeHeader = "X-Github-Event"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
Github represents the SCM provider of Github.
func (*Github) CheckToken ¶
CheckToken checks whether the token has the authority of repo by trying ListRepos with the token
func (*Github) CreateStatus ¶ added in v0.9.6
func (g *Github) CreateStatus(status c_v1alpha1.StatusPhase, targetURL, repoURL, commitSHA string) error
CreateStatus generate a new status for repository.
func (*Github) CreateWebhook ¶
CreateWebhook creates webhook for specified repo.
func (*Github) DeleteWebhook ¶
DeleteWebhook deletes webhook from specified repo.
func (*Github) GetPullRequestSHA ¶ added in v0.9.6
GetPullRequestSHA gets latest commit SHA of pull request.
func (*Github) GetWebhook ¶ added in v0.9.6
GetWebhook gets webhook from specified repo.
func (*Github) ListBranches ¶
ListBranches lists the branches for specified repo.
func (*Github) ListDockerfiles ¶
ListDockerfiles lists the dockerfiles for specified repo.
Click to show internal directories.
Click to hide internal directories.