feat(forge): add CreateIssue to the forge SDK, gitea and github plugins
publish / publish (push) Successful in 1m57s

Mirrors archie-core's proto/forge/v1 change: the SDK Forge interface and
server dispatch gain CreateIssue; gitea resolves label names to IDs
(creating missing labels) and github passes label names through.
This commit is contained in:
sam committed 2026-11-03 02:04:56 +11:00
1 parent d74c5f7421
commit c722517353
6 files changed
+475 -261

No files matched your search

+13
View File
@@ -416,6 +416,19 @@ func (c *GitHubClient) selfLogin(ctx context.Context) (string, error) {
return c.login, nil
}
// CreateIssue opens an issue with title, body and optional labels.
func (c *GitHubClient) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) {
req := &github.IssueRequest{Title: new(title), Body: new(body)}
if len(labels) > 0 {
req.Labels = &labels
}
issue, _, err := c.gh.Issues.Create(ctx, owner, repo, req)
if err != nil {
return 0, apiError(fmt.Sprintf("create issue in %s/%s", owner, repo), err)
}
return issue.GetNumber(), nil
}
// CloseIssue closes an issue with a final comment (feasibility "won't do").
func (c *GitHubClient) CloseIssue(ctx context.Context, owner, repo string, number int, comment string) error {
if comment != "" {