From feaedaf604dd7ce78e9229acc2d51795d38222e7 Mon Sep 17 00:00:00 2001 From: meestark Date: Mon, 11 Aug 2025 01:07:52 +0000 Subject: [PATCH] fix: pass body through in create_release (#82) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What Ensure `create_release` accepts and forwards a `body` so release notes are created as provided. ### Why Previously, the `body` parameter wasn’t threaded through, resulting in empty release notes even when a body was supplied. ### How - Add `body` parameter to the function signature - Thread `body` through handler/service to the API call - Light refactor for clarity; no breaking changes ### Testing - Manual: created a release with a non-empty body and confirmed it appears in the UI and in the releases API response ### Links Fixes gitea/gitea-mcp#81 Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/82 Reviewed-by: hiifong Co-authored-by: meestark Co-committed-by: meestark --- operation/repo/release.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operation/repo/release.go b/operation/repo/release.go index f4d62c3..1167d08 100644 --- a/operation/repo/release.go +++ b/operation/repo/release.go @@ -34,6 +34,7 @@ var ( mcp.WithString("title", mcp.Required(), mcp.Description("release title")), mcp.WithBoolean("is_draft", mcp.Description("Whether the release is draft"), mcp.DefaultBool(false)), mcp.WithBoolean("is_pre_release", mcp.Description("Whether the release is pre-release"), mcp.DefaultBool(false)), + mcp.WithString("body", mcp.Description("release body")), ) DeleteReleaseTool = mcp.NewTool( @@ -131,11 +132,13 @@ func CreateReleaseFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToo } isDraft, _ := req.GetArguments()["is_draft"].(bool) isPreRelease, _ := req.GetArguments()["is_pre_release"].(bool) + body, _ := req.GetArguments()["body"].(string) _, _, err := gitea.Client().CreateRelease(owner, repo, gitea_sdk.CreateReleaseOption{ TagName: tagName, Target: target, Title: title, + Note: body, IsDraft: isDraft, IsPrerelease: isPreRelease, })