// Create an issue func (t *Github) Create(i *messages.Issue) *messages.Issue { // TODO default label must be provided instead of hardcoded ir := github.IssueRequest{ Title: &i.Title, Body: &i.Body, Labels: &[]string{"created"}, } gi, _, err := t.client.Issues.Create(i.Org, i.Repo, &ir) if err != nil { log.Println(err) return nil } i.Number = *gi.Number i.URL = *gi.HTMLURL return i }
func updateIssueTrackerState(i messages.Issue, c messages.Config, to string) { i.Status = to msg := messages.UpdateIssue{ Issue: &i, Config: c, Status: to, } nc, _ := nats.Connect(nats.DefaultURL) nc.Publish("issues.update", ToJSON(msg)) }