Open lfgcampos opened 2 years ago
@lfgcampos Thanks for logging this. This isn't something I've personally encountered, but I can see how some changes would improve things.
We could add a simple markdown template as you've suggested, but I think I'd prefer to limit the output of the existing templates so that up to 50
images are posted to a markdown table. If there's more images than 50
, the table could be omitted.
Perhaps the output could be along the lines of:
Images automagically compressed by Calibre's image-actions ✨
Compression reduced images by <%- overallPercentageSaved %>%, saving <%- overallBytesSaved %>.
<% if(optimisedImages.length < 50) { -%> <!-- table of compression summary, limited to 50 images --><% } %>
<% if(unoptimisedImages.length) { -%> <%- unoptimisedImages.length %> <%- unoptimisedImages.length > 1 ? 'images' : 'image' %> did not require optimisation. <% } %>
What do you think @lfgcampos? Would that cover your use case?
Would you be in a position to help action this change?
Thanks for the quick reply @benschwarz! Sounds good to me!
Another small thing I would add would be the number of optimized images in case the table is not shown. At least we would know how many were optimized and how many wasn't.
Sure, I can try to work on this change as it looks trivial!
PR is opened!
Hi @benschwarz, sorry to bother you but any chance to look at the PR?
What problem would this feature solve?
Currently, the only output we can get from the action is the
steps.calibre.outputs.markdown
which uses either thepr-comment.md
or theinline-pr-comment-with-diff.md
. In certain cases, this template is too big to be used as an environment variables on the Actions runner causing anError: Argument list too long
error.Describe the solution you’d like to see
I would like to see something like a
pr-comment-minimal.md
where you only show the comments and numbers without the big table with all the images and changes that happened. eg:Describe alternatives you’ve considered
Alternative is to not use the output of this action on follow up actions (like the
create-pull-request
one).Additional context
N/A