Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw error on review comments #48

Conversation

hyperupcall
Copy link
Contributor

When adding comments under a review, the action would previously throw an error due to a null body.

Tried looking for the body, but as mentioned in #35, the body of pull request review comments doesn't seem to be documented. The event payload seems to have a review property, but it seems to be associated with the overall review rather than a particular review comment.

review: {
    _links: { html: [Object], pull_request: [Object] },
    author_association: 'MEMBER',
    body: null,
    commit_id: '58e4709c661af8de19e52af500d6808ff0a0504f',
    html_url: 'https://github.com/SchemaStore/schemastore/pull/4587#pullrequestreview-2705553345',
    id: 2705553345,
    node_id: 'PRR_kwDOAZi2O86hQ3fB',
    pull_request_url: 'https://api.github.com/repos/SchemaStore/schemastore/pulls/4587',
    state: 'commented',
    submitted_at: '2025-03-21T11:09:40Z',
    user: {

If one truly needed this feature, somebody could iterate through pulls.listReviewComments for the current PR, and compare it's update_at property with the current review comment's submitted_at property. Although, of course it would lead to bad results if two people comment within the same second. Property values may also be unexpected when updating comments.

For now, simply set body so that no crashes occur.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@orta
Copy link
Collaborator

orta commented Mar 23, 2025

Yeah, this looks good to me 👍🏻

@orta orta merged commit 6b14e5e into OSS-Docs-Tools:master Mar 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants