flatpak-github-actions
flatpak-github-actions copied to clipboard
Do not error if the cache already exists
If a build is able to successfully load a cache, then it will produce an error trying to save a cache with that same key. See the "Annotations" section in https://github.com/rkoesters/xkcd-gtk/actions/runs/1352160876 as an example.
The error is ReserveCacheError and it would be better to log an info message that says the cache already exists instead of an error message. Otherwise, anytime the cache is successfully used, errors are reported.
That's an upstream issue. We can't do much about it
It is not an upstream issue, because this line of code does it: https://github.com/bilelmoussaoui/flatpak-github-actions/blob/master/flatpak-builder/index.js#L155
If that line was deleted then errors would not surface to the GitHub Actions dashboard for a run (although checking the error type and then conditionally reporting an error is likely better behavior).
I'm not really familiar with Javascript, but I think it should be possible to check whether the thrown reason
exception is of type ReserveCacheError
and then not calling core.error
(maybe core.info('Cache already exists, not saving.')
or something). Otherwise (if reason
is not ReserveCacheError
) then the code can call core.error
with the full error message for the user to see.
Thank you!
The issue you're hitting is https://github.com/actions/toolkit/issues/658 and we can't do much about it actually
ideally such error wouldn't happen and the build would work just fine