You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The cached folder must be parameterized to allow user inputs #680
Currently my team uses a different M2 repository path for Maven for some specific reasons.
The current implementation of the action have the paths hardcoded and can't be changed with an input:
constsupportedPackageManager: PackageManager[]=[{id: 'maven',path: [join(os.homedir(),'.m2','repository')],// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---mavenpattern: ['**/pom.xml']},{id: 'gradle',path: [join(os.homedir(),'.gradle','caches'),join(os.homedir(),'.gradle','wrapper')],// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradlepattern: ['**/*.gradle*','**/gradle-wrapper.properties','buildSrc/**/Versions.kt','buildSrc/**/Dependencies.kt','gradle/*.versions.toml','**/versions.properties']},{id: 'sbt',path: [join(os.homedir(),'.ivy2','cache'),join(os.homedir(),'.sbt'),getCoursierCachePath(),// Some files should not be cached to avoid resolution problems.// In particular the resolution of snapshots (ideological gap between maven/ivy).'!'+join(os.homedir(),'.sbt','*.lock'),'!'+join(os.homedir(),'**','ivydata-*.properties')],pattern: ['**/*.sbt','**/project/build.properties','**/project/**.scala','**/project/**.sbt']}];
Justification:
Allow user to adapt to its own environment.
Are you willing to submit a PR?
Yes!
Should the input be a list? How the list will be added to the input parameter? It will be one parameter for each cache type or a single parameter to override the default path list?
Hello @lucasoares , Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.
Anything on this?
Should the input be a list? How the list will be added to the input parameter? It will be one parameter for each cache type or a single parameter to override the default path list?
If you answer these questions I'm willing to open a PR
We have decided to not look into this for the foreseeable future due to its complexity (I know it seems simple, however, it isn't). If we see more customers requesting this capability, we will review again. Closing for now.
We have decided to not look into this for the foreseeable future due to its complexity (I know it seems simple, however, it isn't). If we see more customers requesting this capability, we will review again. Closing for now.
What do you mean by it isn't simple? Would you mind elaborating on that?
I'm asking because I've been maintaining a working fork for years, and for my specific use case it was literally a one line change. I just added another folder to supportedPackageManagers for Maven, which is already implemented as a list. From my perspective, the implementation seemed fairly straightforward, so I'm curious what additional complexity you're referring to.
@lucasoares, thanks for pushing back and asking for clarification. After reviewing the current cache implementation more closely, I agree that the complexity was overstated.
A hardcoded change is only one line, while a supported input also requires API design, restore/save consistency, tests, documentation, and compatibility coverage. However, the underlying implementation is manageable, and configurable cache paths are reasonable for Maven, Gradle, and sbt.
I’ve opened #1173 with a proposed design for a multiline cache-path input. Implementation is now in main.
Activity
v-gowridurgad commentedon Sep 4, 2024
Hello @lucasoares ,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.
lucasoares commentedon Feb 27, 2025
Anything on this?
Should the input be a list? How the list will be added to the input parameter? It will be one parameter for each cache type or a single parameter to override the default path list?
If you answer these questions I'm willing to open a PR
brunoborges commentedon Jul 14, 2026
Hi @lucasoares,
We have decided to not look into this for the foreseeable future due to its complexity (I know it seems simple, however, it isn't). If we see more customers requesting this capability, we will review again. Closing for now.
lucasoares commentedon Jul 29, 2026
What do you mean by
it isn'tsimple? Would you mind elaborating on that?I'm asking because I've been maintaining a working fork for years, and for my specific use case it was literally a one line change. I just added another folder to
supportedPackageManagersfor Maven, which is already implemented as a list. From my perspective, the implementation seemed fairly straightforward, so I'm curious what additional complexity you're referring to.brunoborges commentedon Jul 29, 2026
@lucasoares, thanks for pushing back and asking for clarification. After reviewing the current cache implementation more closely, I agree that the complexity was overstated.
A hardcoded change is only one line, while a supported input also requires API design, restore/save consistency, tests, documentation, and compatibility coverage. However, the underlying implementation is manageable, and configurable cache paths are reasonable for Maven, Gradle, and sbt.
I’ve opened #1173 with a proposed design for a multiline
cache-pathinput. Implementation is now inmain.