fix: pass body through in create_release (#82) All checks were successful release-nightly / release-image (push) Successful in 2m43s
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:
@@ -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, | ||||
}) | ||||
|
Reference in New Issue
Block a user