I want to delete multiple PRs/issues comments at once with GitHub Actions over the GitHub API.
Is there a way to do this without showing the delete message multiple times like the following image?
For example, I thought there may be a way to delete multiple issue/pull request review comments with one request that shows a message like <user> deleted n comments from <users whose comments have been deleted>
?
Currently, I am deleting messages using the following curl command in a loop:
echo "$ids" | while read -r id; do
curl -X "DELETE" -s -H "authorization: token $GITHUB_TOKEN" -H "User-Agent: Actions-<username>/<reponame>" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/<username>/<reponame>/issues/<issue number>/comments/$id"
done
If it is a pull request, I use pulls
with instead of issues
.
I also think that there is a rate limit preventing the deletion of that many commands in such a short time.
See the docs for deleting an issue and a pull request comment.
[Context]
I want to create a command that clears multiple messages at once. If somebody enters /clear 5
for example, the latest 5 messages will be deleted.
Steps to delete a comment In the upper-right corner of the comment, click , then click Delete.
Resolving conversations You can resolve a conversation in a pull request if you opened the pull request or if you have write access to the repository where the pull request was opened. To indicate that a conversation on the Files changed tab is complete, click Resolve conversation.
No, you can't do it. It is a core feature from Github to create a timeline event on any action (like push, comment, rebase, merge, etc). That's a standard placeholder.
https://help.github.com/en/github/building-a-strong-community/managing-disruptive-comments#deleting-a-comment
Also, it looks like Github doesn't support BATCH operations currently.
So, NO and NO at the moment :(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With