Documentation ¶
Index ¶
- Constants
- func ShouldGetNextPage(resp *gitea.Response, currentPage int) (bool, int)
- type Provider
- func (v *Provider) CheckPolicyAllowing(_ context.Context, event *info.Event, allowedTeams []string) (bool, string)
- func (v *Provider) CreateStatus(_ context.Context, event *info.Event, statusOpts provider.StatusOpts) error
- func (v *Provider) CreateToken(_ context.Context, _ []string, _ *info.Event) (string, error)
- func (v *Provider) Detect(req *http.Request, payload string, logger *zap.SugaredLogger) (bool, bool, *zap.SugaredLogger, string, error)
- func (v *Provider) GetCommitInfo(_ context.Context, runevent *info.Event) error
- func (v *Provider) GetConfig() *info.ProviderConfig
- func (v *Provider) GetFileInsideRepo(_ context.Context, runevent *info.Event, path, target string) (string, error)
- func (v *Provider) GetFiles(_ context.Context, runevent *info.Event) (changedfiles.ChangedFiles, error)
- func (v *Provider) GetStringPullRequestComment(_ context.Context, runevent *info.Event, reg string) ([]*gitea.Comment, error)
- func (v *Provider) GetTaskURI(_ context.Context, _ *info.Event, _ string) (bool, string, error)
- func (v *Provider) GetTektonDir(_ context.Context, event *info.Event, path, provenance string) (string, error)
- func (v *Provider) IsAllowed(ctx context.Context, event *info.Event) (bool, error)
- func (v *Provider) IsAllowedOwnersFile(ctx context.Context, rev *info.Event) (bool, error)
- func (v *Provider) ParsePayload(_ context.Context, _ *params.Run, request *http.Request, payload string) (*info.Event, error)
- func (v *Provider) SetClient(_ context.Context, run *params.Run, runevent *info.Event, ...) error
- func (v *Provider) SetLogger(logger *zap.SugaredLogger)
- func (v *Provider) Validate(_ context.Context, _ *params.Run, _ *info.Event) error
- type PushPayload
Constants ¶
const ( EventTypeCreate whEventType = "create" EventTypeDelete whEventType = "delete" EventTypeFork whEventType = "fork" EventTypePush whEventType = "push" EventTypeIssues whEventType = "issues" EventTypeIssueComment whEventType = "issue_comment" EventTypeRepository whEventType = "repository" EventTypeRelease whEventType = "release" EventTypePullRequest whEventType = "pull_request" EventTypePullRequestApproved whEventType = "pull_request_approved" EventTypePullRequestRejected whEventType = "pull_request_rejected" EventTypePullRequestComment whEventType = "pull_request_comment" EventTypePullRequestSync whEventType = "pull_request_sync" )
List of supported events
Find them in Gitea's source at /models/webhook.go as HookEventType. To correlate with when each of these trigger, see the Trigger On -> Custom Events options when editing a repo's webhook in a Gitea project. Those descriptions are helpful.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider struct { Client *gitea.Client Logger *zap.SugaredLogger Token *string // only exposed for e2e tests Password string // contains filtered or unexported fields }
func (*Provider) CheckPolicyAllowing ¶ added in v0.20.0
func (*Provider) CreateStatus ¶
func (*Provider) CreateToken ¶ added in v0.19.0
func (*Provider) Detect ¶
func (v *Provider) Detect(req *http.Request, payload string, logger *zap.SugaredLogger) (bool, bool, *zap.SugaredLogger, string, error)
Detect processes event and detect if it is a gitea event, whether to process or reject it returns (if is a Gitea event, whether to process or reject, logger with event metadata,, error if any occurred).
func (*Provider) GetCommitInfo ¶
func (*Provider) GetConfig ¶
func (v *Provider) GetConfig() *info.ProviderConfig
func (*Provider) GetFileInsideRepo ¶
func (*Provider) GetFiles ¶
func (v *Provider) GetFiles(_ context.Context, runevent *info.Event) (changedfiles.ChangedFiles, error)
func (*Provider) GetStringPullRequestComment ¶
func (v *Provider) GetStringPullRequestComment(_ context.Context, runevent *info.Event, reg string) ([]*gitea.Comment, error)
GetStringPullRequestComment return the comment if we find a regexp in one of the comments text of a pull request.
func (*Provider) GetTaskURI ¶ added in v0.13.0
GetTaskURI TODO: Implement ME.
func (*Provider) GetTektonDir ¶
func (*Provider) IsAllowedOwnersFile ¶ added in v0.22.1
IsAllowedOwnersFile get the owner file from main branch and check if we have explicitly allowed the user in there.
func (*Provider) ParsePayload ¶
func (*Provider) SetLogger ¶
func (v *Provider) SetLogger(logger *zap.SugaredLogger)
type PushPayload ¶ added in v0.23.0
type PushPayload struct {
Commits []gitea.PayloadCommit `json:"commits,omitempty"`
}