Comments (11)
Do we not need you to do a release for us to be able to use that?
@bazzadp Nope. Because GitHub Actions doesn't cache docker image builds. image-actions references a pre-built from the main branch Dockerhub hosted image..
Otherwise folks would have to wait 10+ mins for image actions to run π
from image-actions.
@bazzadp I should've said "could" conflict, was just trying to be mindful of other stuff that was in flight at the time.
changedFilesOnly
seems like a reasonable idea, although I think we've got options that work well enough for the more common use cases.
Leaving this issue open to gauge interest for a while β if you've stumbled across this and think it'd be a useful feature, please let us know.
from image-actions.
@TomasBarry Here's what image actions does:
- After each push to a PR, image-actions is invoked
- Images that match the
glob
finder will be processed - Images that are 'significantly changed' are committed and added to the markdown summary
From what you're saying, it sounds like there's a byte difference of more than 1% each time you've committed.
Is that the case? Do you have any numbers/metrics to share with this report?
It might be that we need to increase the change threshold (say ~3%) to accommodate for cases like this.
Any additional information you have to share will be helpful :-)
from image-actions.
Hi @benschwarz. I actually can't find the data of the most recent examples because the comments were deleted...
An adjustable threshold would be pretty nice. But I was also thinking that it would be good to only run the action on assets in the pull request. In theory, assets not in the pull request should already be compressed and only touched assets should be in a pull request.
If you can point me in the right direction I don't mind having a look at implementing either of the above suggestions.
from image-actions.
Hey @TomasBarry, not sure what version of the image-actions config you're using, but if you haven't updated in a while, I'd recommend doing so.
The suggested default configuration will only run when image files (jpgs, webps etc) are changed within that pull request. Additionally there's also an configuration example for image actions to create pull requests, rather than jump in on work in progress. That might suit your use case better.
Could you check those out and report back?
from image-actions.
Do we not need you to do a release for us to be able to use that?
Also while itβs true that using the config in the README will only run if the PR contains images, of will then compress ALL images - not just those images in the PR. Personally I think thatβs handy, but I can see why a changedFilesOnly
flag could be useful - especially for larger repos.
from image-actions.
@benschwarz, we are using calibreapp/[email protected]
.
As @bazzadp said, a changedFilesOnly
flag would be great but I was not aware that we could use it to create a separate PR which we might actually adopt for the time being.
Is there any intention of a changedFilesOnly
flag in the future? I'd really back this feature given it would make QA on a PR constrained and on larger repos where many teams own many different parts of the code and you're not touching another teams code unless you meant to.
from image-actions.
@TomasBarry, I'm not sure about adding a changedFilesOnly
config flag. It somewhat goes against the intention of having an action that ensures all images are compressed. Of course, I'd not considered the multi-team-repo-ownership use case. π€
Did you switch over to the "Create separate PR" config? Is that likely to work better?
π Implementation note: If we were to add a changedFilesOnly
flag, it would conflict with compressOnly
. It would need to warn about that (and be documented as such).
from image-actions.
π Implementation note: If we were to add a
changedFilesOnly
flag, it would conflict withcompressOnly
. It would need to warn about that (and be documented as such).
Not sure why it would conflict? Obviously it couldn't be used for the on-demand or scheduled options, but it could still be used with pull_requests and pushes if we checked files changed in those.
Personally I think this could still be helpful for large repos, as imaging the run time for the image action on those could be significant. With a changesFilesOnly
option pull requests and pushes can be quick, and the scheduled run, where a user is not waiting for the result, can take longer to do the full repo and make sure no other images were missed, so still abiding by the intention of ensuring all images are compressed.
from image-actions.
Closing this off for now, feel free to weigh in if you have ideas π
from image-actions.
Hey @benschwarz I have this setting for compressing image:
- name: Compress Images
id: calibre
uses: calibreapp/image-actions@main
with:
ignorePaths: 'node_modules/**,build'
compressOnly: true
jpegQuality: '80'
jpegProgressive: false
pngQuality: '80'
webpQuality: '80'
- name: Create New Pull Request If Needed
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v3
with:
title: Compressed raster images
branch: compress-raster-images
branch-suffix: timestamp
body: ${{ steps.calibre.outputs.markdown }}
Calibre keeps opening PR for already optimized images. But this only happens for WebP images and every time the change is of around 1-1.3%.
from image-actions.
Related Issues (20)
- [Feature Request] Simple markdown template HOT 4
- Just a quick question! HOT 2
- [Bug] HTTPError when committing files HOT 3
- [Feature Request] Keep metadata when optimising images
- Limit markdown to 65535? HOT 4
- [Bug] `Input file contains unsupported image format` errors HOT 3
- Could you release major version(s) of your GitHub action? HOT 1
- [Feature Request] Can we have that command line utility for the same ? HOT 1
- Env variables are not being populated as expected HOT 1
- Bad Credentials error when following docs
- [Feature Request] Make a recent release with tag instead of `main` HOT 2
- Files compress in test repo but not Github Pages website even though code is the same. HOT 1
- [Feature Request] Support on-premise github enterprise HOT 2
- [Bug] WebP optimization requires successive passes to optimize HOT 1
- [Feature Request] Add option to disable PR comment HOT 6
- [Feature Request] How to get it to optimize images that are already inside the repo? HOT 1
- [Feature Request] Support for compressing PDFs HOT 2
- [Bug] 'set-output' warning HOT 2
- [Bug] image-actions rotates image unexpectedly HOT 9
- Agree this would be useful. And agree currently it does all files each time - that's working as intended at the moment btw, rather than a bug per se, though can understand why it's not what some would want.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-actions.