fix(ipr): wrap comment body in object for GitHub API calls#3478
Merged
Conversation
createIssueComment and updateIssueComment were passing the body text
directly as options.body, causing JSON.stringify to serialize a bare
string instead of {"body":"..."}. GitHub rejects this with a 422
links/0/schema validation error.
https://claude.ai/code/session_01X5uXrpVmhruUCvywL4r4Gj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a 422 error in the IPR check CI reported on #3468.
createIssueCommentandupdateIssueCommentinscripts/ipr/github.mjswere passing the comment body text directly asoptions.bodytorequest(). Sincerequest()doesJSON.stringify(body), this serialized a bare JSON string ("\"text\"") rather than the object GitHub's API requires ({"body": "text"}). GitHub responds with a 422links/0/schemavalidation error.Non-breaking justification: purely defensive fix to an internal script; no protocol or schema changes.
Pre-PR review:
createStatus(the working method) already passes a nested object;Content-Typeheader remains correct.Session: https://claude.ai/code/session_01X5uXrpVmhruUCvywL4r4Gj
Generated by Claude Code