Documentation
¶
Overview ¶
SOMEWHAT DEPRECATED: labeler provides actions which add labels to issues based on criteria. It also has helper functions for labels. This package needs work.
Index ¶
- Variables
- func AddLabels(context *ctx.Context, owner, repo string, number int, labels []string) error
- func IssueHasLabel(context *ctx.Context, owner, repo string, number int, label string) bool
- func IssueHasPullRequestLabeler(context *ctx.Context, payload interface{}) error
- func RemoveLabel(context *ctx.Context, owner, repo string, number int, label string) error
- func RemoveLabelIfExists(context *ctx.Context, owner, repo string, number int, label string) error
- func RemoveLabels(context *ctx.Context, owner, repo string, number int, labels []string) error
- type LabelerHandler
- type PullRequestHandler
- type PushHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var PendingRebaseNeedsWorkPRUnlabeler = func(context *ctx.Context, payload interface{}) error { event, ok := payload.(*github.PullRequestEvent) if !ok { return context.NewError("PendingRebaseUnlabeler: not a pull request event") } if *event.Action != "synchronize" { return nil } owner, repo, num := *event.Repo.Owner.Login, *event.Repo.Name, *event.Number log.Printf("checking the mergeability of %s/%s#%d in %d sec...", owner, repo, num, repoMergeabilityCheckWaitSec) time.Sleep(repoMergeabilityCheckWaitSec * time.Second) var err error if isMergeable(context, owner, repo, num) { err = RemoveLabelIfExists(context, owner, repo, num, "pending-rebase") if err != nil { log.Printf("error removing the pending-rebase label: %v", err) } err = RemoveLabelIfExists(context, owner, repo, num, "needs-work") } else { err = fmt.Errorf("%s/%s#%d is not mergeable", owner, repo, num) } if err != nil { log.Printf("error removing the pending-rebase & needs-work labels: %v", err) } return err }
Functions ¶
func IssueHasLabel ¶
func RemoveLabel ¶
func RemoveLabelIfExists ¶
Types ¶
type LabelerHandler ¶
type LabelerHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(context *ctx.Context, pushHandlers []PushHandler, pullRequestHandlers []PullRequestHandler) *LabelerHandler
NewHandler returns an HTTP handler which deprecates repositories by closing new issues with a comment directing attention elsewhere.
func (*LabelerHandler) HandlePayload ¶
func (h *LabelerHandler) HandlePayload(w http.ResponseWriter, r *http.Request, payload []byte)
type PullRequestHandler ¶
type PullRequestHandler func(context *ctx.Context, event github.PullRequestEvent) error
Click to show internal directories.
Click to hide internal directories.