github-pr-resource
github-pr-resource copied to clipboard
delete_previous_comments has no effect
I'm passing delete_previous_comments: true in the parameters to my put step on this resource, along with comment: my comment. Check status is updated, the new comment gets added but the previous comments are not removed.
I'm using a GitHub app token with read & write permissions on pull requests. Is there anything I'm missing?
Hi,
Have you tried modifying the E2E test, that's available? Look at TestPutCommentsE2E and modify the underlying owner of the repo, to match one you're using and get back to us with the result.
@rickardl I'll give that a try, thanks.
Hey 👋🏻
I had a similar issue, specifically:
- My user was a GitHub Bot App
- It didn't delete comments
- Using OAuth on a personal account it did. The issue occurs here:
https://github.com/telia-oss/github-pr-resource/blob/9ec47e2d9f28d13a4738ff48f2f40d2a570b251a/github.go#L398
When evaluating, it comes out to:
+ if "githubApp" == "githubApp[bot]"
- if e.Node.Author.Login == getComments.Viewer.Login {
Specifically, getComments.Viewer.Login returns the name with [bot] but e.Node.Author.Login returns it without bot.