October 15, 2020
A year ago, we released Image Actions, a GitHub Action that automatically optimises images in your pull requests. Since then, it has become one of the most popular actions, helping builders for the web ensure their visuals don’t negatively affect performance and user experience.
Here’s a summary of the most critical changes in Image Actions 2.0.
Often, the concern with image optimisation, especially when it’s automated, is a significant quality loss. We now leverage GitHub’s visual diffing so you can ensure the results match your standards. Every compressed image has a link to view a comparison between versions.
By default, Image Actions adds optimised images to the current Pull Request and posts a summary comment. The new compressOnly option allows skipping those steps to enable more complex workflows.
For example, compressOnly allows working around the GitHub Actions limitation of not being able to alter pull requests coming from forked repositories. You can combine all of those options in an all-encompassing workflow that will cater to most scenarios. See a code example here.
Sometimes, running optimisations only when a pull request is open might not be enough. Thanks to the new compressOnly mode and additional GitHub Actions (like create-pull-request), you can schedule when optimisations should run. For example, you could schedule an on-demand compression at a selected time, once a week, to make sure no visuals slip through the cracks.
If you are using Git Large File Storage (LFS) extension in your repositories, you can now use Image Actions.
We have made numerous improvements to the experience of contributing and working with Image Actions.
The project README has been revamped to explain the usage, available configuration options and contributing guidelines better. When creating an issue or pull request, pre-baked templates will ensure we have the necessary details to timely triage problems and merge new releases. Image Actions also now operates under a Code of Conduct, which provides standards for a safe and welcoming space we want to foster.
Lastly, we converted Image Actions to TypeScript. It’s now easier to develop and contribute thanks to type checking and compilation.
We continue working on Image Actions and other open source tools to help the community improve the performance of their projects and products. Image Actions is free, doesn’t require any new registrations outside of an existing GitHub account and has a simple set up. Get started here.
We will send you the latest web performance articles, tools, case studies and more, so you can become a better performance advocate.