Revert "add all MISE_ env vars to cache key (#197)"

This reverts commit a5b33d7b88.
This commit is contained in:
jdx 2025-06-25 11:54:34 -05:00
parent 429184fe4b
commit 233d283dd6
No known key found for this signature in database
GPG key ID: 584DADE86724B407
3 changed files with 7 additions and 17 deletions

9
dist/index.js generated vendored
View file

@ -66597,10 +66597,7 @@ async function restoreMiseCache() {
core.startGroup('Restoring mise cache');
const version = core.getInput('version');
const installArgs = core.getInput('install_args');
// all env vars that start with MISE_ are used in the cache key
// this allows users to set MISE_ENV or other variables that affect the cache
// without having to modify the cache key prefix
const env_key = JSON.stringify(Object.fromEntries(Object.entries(process.env).filter(([key]) => key.startsWith('MISE_'))));
const { MISE_ENV } = process.env;
const cachePath = miseDir();
const fileHash = await glob.hashFiles([
`**/.config/mise/config.toml`,
@ -66634,8 +66631,8 @@ async function restoreMiseCache() {
if (version) {
primaryKey = `${primaryKey}-${version}`;
}
if (env_key) {
primaryKey = `${primaryKey}-${env_key}`;
if (MISE_ENV) {
primaryKey = `${primaryKey}-${MISE_ENV}`;
}
if (installArgs) {
const tools = installArgs

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -74,14 +74,7 @@ async function restoreMiseCache(): Promise<string | undefined> {
core.startGroup('Restoring mise cache')
const version = core.getInput('version')
const installArgs = core.getInput('install_args')
// all env vars that start with MISE_ are used in the cache key
// this allows users to set MISE_ENV or other variables that affect the cache
// without having to modify the cache key prefix
const env_key = JSON.stringify(
Object.fromEntries(
Object.entries(process.env).filter(([key]) => key.startsWith('MISE_'))
)
)
const { MISE_ENV } = process.env
const cachePath = miseDir()
const fileHash = await glob.hashFiles(
[
@ -117,8 +110,8 @@ async function restoreMiseCache(): Promise<string | undefined> {
if (version) {
primaryKey = `${primaryKey}-${version}`
}
if (env_key) {
primaryKey = `${primaryKey}-${env_key}`
if (MISE_ENV) {
primaryKey = `${primaryKey}-${MISE_ENV}`
}
if (installArgs) {
const tools = installArgs