...

Source file src/edge-infra.dev/pkg/f8n/devinfra/jack/plugin/enforce_milestone/handler.go

Documentation: edge-infra.dev/pkg/f8n/devinfra/jack/plugin/enforce_milestone

     1  package enforcemilestone
     2  
     3  import (
     4  	"github.com/google/go-github/v47/github"
     5  
     6  	"edge-infra.dev/pkg/f8n/devinfra/jack/constants"
     7  	"edge-infra.dev/pkg/f8n/devinfra/jack/plugin"
     8  )
     9  
    10  func init() {
    11  	plugin.RegisterIssueHandler(constants.PluginEnforceMilestone, handleIssue)
    12  }
    13  
    14  func handleIssue(hp plugin.HandlerParams, ie github.IssuesEvent) {
    15  	hp.Log.WithName(constants.PluginEnforceMilestone)
    16  
    17  	switch action := ie.GetAction(); action {
    18  	case "opened":
    19  		openingMilestone(hp, ie)
    20  	case "labeled":
    21  		checkLabel(hp, ie)
    22  	case "unlabeled":
    23  		checkRemoveLabel(hp, ie)
    24  	case "milestoned":
    25  		removeMilestoneLabel(hp, ie)
    26  	}
    27  }
    28  

View as plain text