diff --git a/internal/forge/github.go b/internal/forge/github.go index 3bcf6028c..c5fb6c094 100644 --- a/internal/forge/github.go +++ b/internal/forge/github.go @@ -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