fix: pass body through in create_release (#82)
All checks were successful
release-nightly / release-image (push) Successful in 2m43s

### 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: #82 Reviewed-by: hiifong <i@hiif.ong> Co-authored-by: meestark <meestark@meestark.net> Co-committed-by: meestark <meestark@meestark.net>
This commit was merged in pull request #82.
This commit is contained in:
2025-08-11 01:07:52 +00:00
committed by hiifong
parent a601d6b698
commit feaedaf604

View File

@@ -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,
})