package workintake import "strings" // SubjectTask is where every issue-intake task is published. Routing to a // workflow happens at pin time from the intake-routes setting, so the subject // carries nothing about the issue. const SubjectTask = "archie.task.issue" // SubjectTaskWildcard matches every task subject. const SubjectTaskWildcard = "archie.task.>" // SubjectReactionWildcard matches every reaction subject. const SubjectReactionWildcard = "archie.reaction.>" // LabelValue returns the part of a label after its last "::", so a scoped // label such as "kind::bug" matches the rule for "bug". func LabelValue(label string) string { trimmed := strings.TrimSpace(label) if i := strings.LastIndex(trimmed, "::"); i >= 0 { return strings.TrimSpace(trimmed[i+len("::"):]) } return trimmed }