Github Action PR edit comment instead of create comment

I’ve setup SonarCloud Github Action on my repository in GitHub. I works great; every time a PR is created it runs the analysis. It also runs for every commit within the PR, creating a new comment with new information and deleting the old comment.

Would it be possible to edit the first existing comment, instead of creating a new comment every time?

This would prevent spamming people’s inbox.

Codecov does this too.

Example PR: Test with different eslint & angular versions in CI by jerone · Pull Request #4 · jerone/eslint-plugin-angular-template-consistent-this · GitHub

Hi @jerone ,
Thanks for your contribution.
I think this implementation design was chosen for the following reason: we wanted to let users be able to track changes made on PRs.
If the comment is only updated, there is no way for your teammates to know what has been done on the PR (of course they can see commits title and content, but still).

Isn’t there any way on GitHub to prevent notifications?

Hope to help :slight_smile:
Christophe

My example PR was short, but if it contains a long discussion, the latest overview comment would be out of initial view very quickly. In contrast to the Codecov comment, which stays at the top for easy access.

Another reason to use edits (instead of deletes), is history. Right now, old comments are being deleted. Removing any history about improving quality. Again, see Codecov edited-dropdown.

Isn’t there any way on GitHub to prevent notifications?

Sadly not that I know of. You can block an bot, but that will ignore all messages.