feat(forge): ClosePR on the SDK, GitHub and Gitea forges

This commit is contained in:
sam committed 2026-10-05 20:11:43 +11:00
1 parent 6c2f1b20dd
commit ca1bd1de11
6 files changed
+412 -228

No files matched your search

+13
View File
@@ -350,6 +350,19 @@ func (c *GitHubClient) CloseIssue(ctx context.Context, owner, repo string, numbe
return err
}
// ClosePR closes a pull request without merging, with an optional final
// comment.
func (c *GitHubClient) ClosePR(ctx context.Context, owner, repo string, number int, comment string) error {
if comment != "" {
if _, err := c.Comment(ctx, owner, repo, number, comment); err != nil {
return err
}
}
_, _, err := c.gh.PullRequests.Edit(ctx, owner, repo, number,
&github.PullRequest{State: new("closed")})
return err
}
// LinkBranch associates a branch with an issue (GitHub stub -- Gitea is primary).
func (c *GitHubClient) LinkBranch(ctx context.Context, owner, repo string, issueNumber int, branch string) error {
return nil