示例#1
0
// 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
}
示例#2
0
文件: hook.go 项目: supu-io/core
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))
}