Conversation
|
The question is what will happen with existing workflows that might have a manual cache setup.
(Correct me if I'm wrong here.) I wonder how to detect if there's an existing cache setup. There probably is no way. |
|
One thought: using a dedicated action input like |
|
Thank you for working on this!
As someone setting the action up from scratch, you might be wondering then "How many times do I need to tell this action that it should use a cache? :)" In my experience, many actions enable a cache by default these days because it is basically always what you want and the action maintainers likely know best how the cache should be managed. My vote would go down for a new major version of the action, with an on-by-default cache and perhaps with |
|
Yeee, this works as well and is probably clearer and easier for people using the action. I actually thought about it too, but wasn’t sure if it was worth pushing another release just for this change, especially since there aren't any other updates lined up right now. |
|
Fair point. I think we could wait a bit before we merge this. People interested could already use it (and remove the existing cache if any): - name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@cache
with:
fail: falseIn fact, I believe it would be best if someone could test it for a while to fix any edge-cases. @thomaseizinger wanna volunteer? 😬 |
Definitely! We are facing 429s on our daily cron suddenly and I am planning to see if the cache mitigates that. |
|
Maybe another case of #289? |
|
Is this branch safe to depend on? We are hash-pinning all actions in our CI so if you'd like me to test this, I'd ask to please not force-push to this branch :) |
|
To be on the safe side, you can also use the commit sha: This won't change. |
Helping the lychee team test some new changes. Related: lycheeverse/lychee-action#292
Helping the lychee team test some new changes. Related: lycheeverse/lychee-action#292
|
@thomaseizinger, did you run into any issues so far? If not, I guess this is safe to merge (and release 3.0). 😄 |
|
still think adding an explicit action argument ( It could default to true, but still check for --cache to avoid conflicts. That said, --cache shouldn't automatically enable GitHub caching keeping that opt-in gives users more flexibility for custom setups. Otherwise, looks good to me! |
No issue related to the cache! |
|
Thanks for the feedback @thomaseizinger. @Arteiii, I think it's a great idea to have a dedicated action argument for it. +1 for that. We should add it before the merge.
Can you give me an example of a custom setup where |
|
I can't think of a setup where the built-in cache wouldn't be enough, but custom setups might exist. To avoid breaking anything, I’d suggest:
This keeps things explicit without changing behavior for existing setups. |
this also makes things more explicit, since we shouldn't modify the Action's behavior based on arguments passed to Lychee via |
|
In general im in favour of the proposal of @mre since it's just easier for the vast majority of users. In my opinion it boils down to the following: is it still possible to manually override the caching behaviour introduced in this PR? If so, I think we should go with the approach suggested by @mre. When bumping the major version of the action we are allowed to introduce breaking changes. Users with custom caching logic could stay on the current version or adapt and update. |
| - name: Restore lychee cache | ||
| id: restore-cache | ||
| if: steps.cache-check.outputs.cache_enabled == 'true' | ||
| uses: actions/cache/restore@v4 |
This adds GitHub Actions caching for the
.lycheecachefile when the--cacheflag is present.Important Notes
.lycheecachefile, not the lychee binary--cacheis present in the lychee arguments!cancelled()condition)github.shafor uniqueness with fallback to previous cachesworkingDirectoryinputUsage Example
When users include
--cachein their arguments:The action will:
--cacheflag.lycheecachefile before running.lycheecachefile after runningWithout
--cache, no GitHub Actions caching occurs, preventing any issues in restricted environments.Fixes #291.