Reuse comments created by Expo-Bot
D
Danny van der Biezen
Using
comment_on_pr:
name: Post Results to PR
after:
[
android_qa_build,
ios_device_qa_build,
ios_simulator_qa_build,
publish_android_update,
publish_ios_update,
]
type: github-comment
Will result in a new comment each time this task is triggered. It would be great if we can reuse the comment generated by the bot from previous runs. This would significantly reduce noise created by the bot, making it easier for our devs and qa engineers to find the builds they're looking for.
Ash Wu
Hi Danny, thanks for the feedback!
The
github-comment
job is actually already designed to reuse existing comments. Under the hood, each comment is tagged with a unique identifier based on the PR number, workflow definition, and job key. When the job runs again on the same PR, it searches for an existing comment with that identifier and updates it in place rather than creating a new one.So if you're running the same workflow on the same PR multiple times, you should see only one comment that gets updated with the latest results.
If you're seeing duplicate comments being created, that would be unexpected — could you share a workflow run link (or PR link) where this happened? That would help us investigate what's going on.