Awesome
Roborazzi compare snapshot comment on GitHub pull request sample
This is a sample repository to demonstrate how to use Roborazzi to compare snapshots on GitHub pull requests.
Example of the comment
<img src="https://user-images.githubusercontent.com/1386930/236480693-80483cde-53fe-4c04-ba1f-2352e14b5f15.png" width="600" />How to use
Please refer to the .github/workflows directory for the workflow definitions.
StoreScreenshot.yml is the workflow to store the screenshot of the pull request.
CompareScreenshot.yml is the workflow to compare the screenshot of the pull request with the one of the base branch.
CompareScreenshotComment.yml is the workflow to comment the result of the comparison on the pull request.
About the companion branch approach
The companion branch approach is a way to store the screenshot of the feature branches. When a pull request is created, the screenshot of the feature branch is stored in the companion branch. When the branch is outdated, the branch is deleted. This approach allows users to see changes of the screenshot of the feature branch on pull requests. Outdated branches are deleted to reduce the Git repository size and ensure that only relevant screenshots are retained.
<img src="https://user-images.githubusercontent.com/1386930/236188326-ddd617ae-b216-476c-9d92-e36ad02a2670.png" width="600" />Why not use GitHub Actions artifacts?
GitHub Actions artifacts is a good way to store the screenshot. However, it is not easy to see the changes of the screenshot on pull requests because the artifacts are stored as a zip file. It seems LFS has the same problem.
Why not commit the screenshot to the feature branch?
It is also a good way to store the screenshot. However, the stored screenshot is not deleted and remains in the repository because Git keeps the history of the commits.