Add MISE_ENV to cache key if set (#196)

Fixes #169
This commit is contained in:
Prashant V 2025-05-26 17:13:00 -07:00 committed by GitHub
parent c94f0bf9e5
commit 367a97c7a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 460 additions and 452 deletions

View file

@ -62,6 +62,7 @@ async function restoreMiseCache(): Promise<string | undefined> {
core.startGroup('Restoring mise cache')
const version = core.getInput('version')
const installArgs = core.getInput('install_args')
const { MISE_ENV } = process.env
const cachePath = miseDir()
const fileHash = await glob.hashFiles(
[
@ -97,6 +98,9 @@ async function restoreMiseCache(): Promise<string | undefined> {
if (version) {
primaryKey = `${primaryKey}-${version}`
}
if (MISE_ENV) {
primaryKey = `${primaryKey}-${MISE_ENV}`
}
if (installArgs) {
const tools = installArgs
.split(' ')