Avoid `sbt` cache being invalidated for a library that is only incrementing its own version
Description:
While working on guardian/gha-scala-library-release-workflow I noticed that no matter how many times I ran the workflow, actions/setup-java would always report sbt cache is not found, even if there had been no substantial change in the project - simply that the version number in version.sbt (the file used by sbt/sbt-release) had been incremented (as in https://github.com/guardian/play-secret-rotation/commit/b2152325baf80f57e7c510fe03ccda5596c139d6).
This meant that turning on cache: sbt would actually slow the workflow considerably, as it would never benefit from the cache being present, and would always have to save it, which could take 2-3 minutes - even though it can't take advantage of the data it's saving.
As such, it would be great to exclude version.sbt files from the cache hash key.
Background: cache: sbt was originally introduced with https://github.com/actions/setup-java/pull/302 - cc @fmeriaux 🙇♂️
Check list:
- [ ] Mark if documentation changes are required.
- [ ] Mark if tests were added or updated to cover the changes.
Interesting, perhaps it would be a good idea to have an action parameter that allows you to complete the pattern by default?
This would give us finer control over the specifics of our projects.