fix(cache): replace , in MISE_ENV with - (#278)

Fixes https://github.com/jdx/mise-action/issues/276

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Replaces commas in MISE_ENV with hyphens when constructing the cache
key to ensure stable/valid keys.
> 
> - **Cache Key Generation**:
> - In `src/index.ts`, normalizes `MISE_ENV` via `replace(/,/g, '-')`
and uses it as `mise_env` when building the cache key template.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
899df938a6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
This commit is contained in:
Risu 2025-10-02 10:16:12 +10:00 committed by GitHub
parent a09b8e9f78
commit 2f998c07b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 11 deletions

View file

@ -396,7 +396,7 @@ async function processCacheKeyTemplate(template: string): Promise<string> {
const version = core.getInput('version')
const installArgs = core.getInput('install_args')
const cacheKeyPrefix = core.getInput('cache_key_prefix') || 'mise-v0'
const { MISE_ENV } = process.env
const miseEnv = process.env.MISE_ENV?.replace(/,/g, '-')
const platform = await getTarget()
// Calculate file hash
@ -421,7 +421,7 @@ async function processCacheKeyTemplate(template: string): Promise<string> {
cache_key_prefix: cacheKeyPrefix,
platform,
file_hash: fileHash,
mise_env: MISE_ENV,
mise_env: miseEnv,
install_args_hash: installArgsHash
}