mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-21 16:51:53 +00:00
fix: correct cache key precedence to match runtime behavior
The cache key was preferring environment input over process.env.MISE_ENV, but setEnvVars() does the opposite (existing MISE_ENV takes precedence). This caused a cache key/runtime mismatch when both were set. Now both use the same precedence: process.env.MISE_ENV || environment input This ensures the cache key always matches the actual MISE_ENV value that will be used at runtime. Also corrected CHANGELOG.md to remove inaccurate statement about env input. Fixes precedence inversion identified by Greptile review.
This commit is contained in:
parent
74e6914774
commit
d6d59bb04f
4 changed files with 8 additions and 8 deletions
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
|
|
@ -85189,10 +85189,10 @@ async function processCacheKeyTemplate(template) {
|
|||
const version = getInput('version');
|
||||
const installArgs = getInput('install_args');
|
||||
const cacheKeyPrefix = getInput('cache_key_prefix') || 'mise-v1';
|
||||
// Check environment input first, then fall back to process.env.MISE_ENV
|
||||
// This ensures the cache key includes the environment even before setEnvVars() runs
|
||||
// Match the precedence in setEnvVars(): process.env.MISE_ENV takes precedence over environment input
|
||||
// This ensures the cache key matches the runtime MISE_ENV value
|
||||
const environmentInput = getInput('environment');
|
||||
const miseEnv = (environmentInput || process.env.MISE_ENV || '').replace(/,/g, '-');
|
||||
const miseEnv = (process.env.MISE_ENV || environmentInput || '').replace(/,/g, '-');
|
||||
const platform = await getTarget();
|
||||
// Calculate file hash
|
||||
const fileHash = await hashFiles(MISE_CONFIG_FILE_PATTERNS.join('\n'));
|
||||
|
|
|
|||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue