Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The cached folder must be parameterized to allow user inputs #680

Open
lucasoares opened this issue Sep 3, 2024 · 1 comment
Open

The cached folder must be parameterized to allow user inputs #680

lucasoares opened this issue Sep 3, 2024 · 1 comment
Labels
feature request New feature or request to improve the current logic

Comments

@lucasoares
Copy link

lucasoares commented Sep 3, 2024

Description:

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:

const supportedPackageManager: PackageManager[] = [
  {
    id: 'maven',
    path: [join(os.homedir(), '.m2', 'repository')],
    // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
    pattern: ['**/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---gradle
    pattern: [
      '**/*.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?

@lucasoares lucasoares added feature request New feature or request to improve the current logic needs triage labels Sep 3, 2024
@gowridurgad
Copy link

Hello @lucasoares ,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

2 participants