forge/github: implement CreateIssue to un-stub the method

Replaces the 'not yet implemented' stub with a real call to
go-github's Issues.Create, mapping title, body, and labels.
This commit is contained in:
sam committed 2026-08-12 13:49:20 +10:00
1 parent 367637d174
commit a56f95d967
1 file changed
+11 -2
+11 -2
View File
@@ -209,9 +209,18 @@ func (c *GitHubClient) LinkBranch(ctx context.Context, owner, repo string, issue
return nil
}
// CreateIssue opens a new issue and returns its number (stub -- Gitea is primary).
// CreateIssue opens a new issue and returns its number.
func (c *GitHubClient) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) {
return 0, fmt.Errorf("GitHub CreateIssue not yet implemented")
req := &github.IssueRequest{
Title: &title,
Body: &body,
Labels: &labels,
}
iss, _, err := c.gh.Issues.Create(ctx, owner, repo, req)
if err != nil {
return 0, fmt.Errorf("create issue %s/%s: %w", owner, repo, err)
}
return iss.GetNumber(), nil
}
// State labels mirror the task lifecycle onto the forge so archie's