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.