Skip to content

Github API post comment error: body is too long #89

Closed
@lnjX

Description

@lnjX

I'm encountering the following error:

Posting comment(s)
  ERROR:CPP Linter:response returned 422 from POST https://api.github.com/repos/qxmpp-project/qxmpp/commits/46f2f3dbc69270de2a82b0db37cc69422bb3c435/comments with message: {"message":"Validation Failed","errors":[{"resource":"CommitComment","code":"custom","field":"body","message":"body is too long (maximum is 65536 characters)"}],"documentation_url":"https://docs.github.com/rest/commits/comments#create-a-commit-comment"}
  Traceback (most recent call last):
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/bin/cpp-linter", line 8, in <module>
      sys.exit(main())
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/lib/python3.10/site-packages/cpp_linter/__init__.py", line 93, in main
      rest_api_client.post_feedback(
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/lib/python3.10/site-packages/cpp_linter/rest_api/github_api.py", line 235, in post_feedback
      self.update_comment(comment, comments_url, no_lgtm, update_only, is_lgtm)
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/lib/python3.10/site-packages/cpp_linter/rest_api/github_api.py", line 329, in update_comment
      self.api_request(url=comments_url, method=req_meth, data=payload)
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/lib/python3.10/site-packages/cpp_linter/rest_api/github_api.py", line 130, in api_request
      response.raise_for_status()
    File "/home/runner/work/_actions/cpp-linter/cpp-linter-action/v2/venv/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
      raise HTTPError(http_error_msg, response=self)
  requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.github.com/repos/qxmpp-project/qxmpp/commits/46f2f3dbc69270de2a82b0db37cc69422bb3c435/comments

For example, see the following pipeline:
https://github.com/qxmpp-project/qxmpp/actions/runs/8272603618/job/22634759413#step:3:2201

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions