-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
update comment if it exists #90
Comments
I started a branch to attempt this, but I haven't tested it yet I added a new action input named |
I ran a preliminary test on a recent PR with 2 identical report comments, and it worked as expected: deleted all but first report comments and updated the first report comment. However, github is not showing any edits to the updated report comment since it's contents were technically not changed. I plan to do some more involved field testing on a private dummy repo, but I'm not sure how far I should take these field tests... @per1234 Is this feature request desirable? |
My changes work on a private repo also. The only hitch with a private repo is that |
This problem does not apply to this repo because the media type used here:
defaults to raw+json for the REST API endpoint /repos/{owner}/{repo}/issues/{PR_number}/comments (per github docs).
|
ping @per1234 |
Describe the request
Instead of posting a new comment every time this action is run, would it be feasible to update an existing comment if it exists? This request is meant to reduce the notifications/emails that get triggered.
Codecov had to support a new config option to allow such behavior. See additional context below about identifying bot comments.
Describe the current behavior
I could set the action to only run when a PR is opened or re-opened. But if I want a new report generated/posted after changes have been made to an already open PR, then I have to close and re-open the PR. This makes refreshing the reports in a PR not intuitive for team members that are not intimately familiar with github actions.
If I set the action to run on a PR sync event, then the old comment remains while a new comment is posted. This makes it feel like a bot is spamming the PR thread. Furthermore, I have to manually hide any previous report comments to reduce the visual noise in the PR thread.
'arduino/report-size-deltas' version
arduino/report-size-deltas@v1
Additional context
I know that comments posted with the generic builtin "github-actions" bot are not exclusive to the action that posted the comment (presumably via REST API). For my cpp-linter-action's thread-comments feature, we decided to include a HTML comment as the first line of the thread comment to identify which one(s) were posted by our cpp-linter-action. This works well for REST API requests that employ the
raw
media type (which seems to the default when applicable).Of course, identifying a comment would be easier if using a registered GitHub App, but my understanding is that would require hosting a webapp from a server which can be costly.
Issue checklist
The text was updated successfully, but these errors were encountered: