Closed Anirban166 closed 8 months ago
The final approach I used was to go with something that I explored nearly three years ago: https://github.com/Anirban166/dlcompare-bug/commit/34144c360aacaab1c2d0ebf1f4cdf420caf86453#comments
As I gathered, Iterative's CML workflows provide convenient containers (with common technologies and system dependencies configured) and their GitHub Actions pipeline allows for one to publish content in PRs without much hassle (which is perfect for my use case!).
Got it to work after some tinkering - Example Plot.
I discarded the idea of having a link to the zipped artifact as a comment for a pull request.
While it does work (using a combination of upload-artifact and one among the two options I got to work for commenting text in PR threads), it's a very indirect approach, requires the user to download the artifact, and for me to maintain a repository for archiving those artifacts keeping in mind the long-term retention and accessibility to them.
In response, I tried to have the image directly shown in the comment. The first approach I tried was to convert the image data (bytes) to base64 and then enclose it in a call to the GitHub API using github-script (to include it as a new comment under the GitHub-Actions bot), but the decoding wasn't proper:
The second approach was to use actions-comment-pull-request with a direct specification of the plot file (as opposed to a folder) but it led to failed image uploads: