From 6a8931b7bb26583959ec1a2a8ac56a5d91621445 Mon Sep 17 00:00:00 2001 From: Samir M Date: Fri, 4 Dec 2026 15:10:57 +0100 Subject: [PATCH 1/2] BUILD-12715 Let only one cache own the mise data directory in config actions --- config-npm/action.yml | 1 + config-poetry/action.yml | 1 + config-uv/action.yml | 1 + spec/mise-cache-owner_spec.sh | 23 +++++++++++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 spec/mise-cache-owner_spec.sh diff --git a/config-npm/action.yml b/config-npm/action.yml index cd62d8a6..39e66db0 100644 --- a/config-npm/action.yml +++ b/config-npm/action.yml @@ -89,6 +89,7 @@ runs: if: steps.config-npm-completed.outputs.skip != 'true' with: version: 2026.10.17 + cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 if: steps.config-npm-completed.outputs.skip != 'true' diff --git a/config-poetry/action.yml b/config-poetry/action.yml index 89b0a489..f43c64d2 100644 --- a/config-poetry/action.yml +++ b/config-poetry/action.yml @@ -114,6 +114,7 @@ runs: if: steps.config-poetry-completed.outputs.skip != 'true' with: version: 2026.10.17 + cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 if: steps.config-poetry-completed.outputs.skip != 'true' diff --git a/config-uv/action.yml b/config-uv/action.yml index 5ff71b93..9815efd4 100644 --- a/config-uv/action.yml +++ b/config-uv/action.yml @@ -102,6 +102,7 @@ runs: if: steps.config-uv-completed.outputs.skip != 'true' with: version: 2026.10.17 + cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 if: steps.config-uv-completed.outputs.skip != 'true' diff --git a/spec/mise-cache-owner_spec.sh b/spec/mise-cache-owner_spec.sh new file mode 100644 index 00000000..a25ec274 --- /dev/null +++ b/spec/mise-cache-owner_spec.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +eval "$(shellspec - -c) exit 1" + +mise_action_cache_setting() { + awk ' + /uses: step-security\/mise-action@/ { in_step = 1; next } + in_step && /^ - / { exit } + in_step && /^ cache:/ { print $2; exit } + ' "$1/action.yml" +} + +Describe 'mise data directory ownership' + Parameters + config-poetry + config-uv + config-npm + End + + It "keeps the mise cache of $1 disabled so it cannot overwrite a restored mise installation" + When call mise_action_cache_setting "$1" + The output should equal 'false' + End +End From b18bb3f56e5d2f5293622388fadfdccf63bbec23 Mon Sep 17 00:00:00 2001 From: Samir M Date: Fri, 4 Dec 2026 16:19:25 +0100 Subject: [PATCH 2/2] BUILD-12715 Install config action tools through mise-action-wrapper with its cache disabled --- config-npm/action.yml | 3 +-- config-poetry/action.yml | 3 +-- config-uv/action.yml | 3 +-- spec/mise-cache-owner_spec.sh | 23 +++++++++++++++++------ 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/config-npm/action.yml b/config-npm/action.yml index 39e66db0..6daa3724 100644 --- a/config-npm/action.yml +++ b/config-npm/action.yml @@ -85,10 +85,9 @@ runs: "Use \`disable-caching\` instead." >&2 fi - - uses: step-security/mise-action@a225bbd7c202ddf57dd76dff22bb7992f6314173 # v5.1.2 + - uses: SonarSource/mise-action-wrapper@058f4c006a2dd0dc3152f37d019bae6c65093b59 # 2.2.0 if: steps.config-npm-completed.outputs.skip != 'true' with: - version: 2026.10.17 cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 diff --git a/config-poetry/action.yml b/config-poetry/action.yml index f43c64d2..86c8df57 100644 --- a/config-poetry/action.yml +++ b/config-poetry/action.yml @@ -110,10 +110,9 @@ runs: key: poetry-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ hashFiles('poetry.lock') }} restore-keys: poetry-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}- - - uses: step-security/mise-action@a225bbd7c202ddf57dd76dff22bb7992f6314173 # v5.1.2 + - uses: SonarSource/mise-action-wrapper@058f4c006a2dd0dc3152f37d019bae6c65093b59 # 2.2.0 if: steps.config-poetry-completed.outputs.skip != 'true' with: - version: 2026.10.17 cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 diff --git a/config-uv/action.yml b/config-uv/action.yml index 9815efd4..a05fa2bb 100644 --- a/config-uv/action.yml +++ b/config-uv/action.yml @@ -98,10 +98,9 @@ runs: format('{0}/pyproject.toml', inputs.working-directory)) }} restore-keys: uv-${{ runner.os }}- - - uses: step-security/mise-action@a225bbd7c202ddf57dd76dff22bb7992f6314173 # v5.1.2 + - uses: SonarSource/mise-action-wrapper@058f4c006a2dd0dc3152f37d019bae6c65093b59 # 2.2.0 if: steps.config-uv-completed.outputs.skip != 'true' with: - version: 2026.10.17 cache: false - uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0 diff --git a/spec/mise-cache-owner_spec.sh b/spec/mise-cache-owner_spec.sh index a25ec274..1f46664d 100644 --- a/spec/mise-cache-owner_spec.sh +++ b/spec/mise-cache-owner_spec.sh @@ -1,14 +1,19 @@ #!/usr/bin/env bash eval "$(shellspec - -c) exit 1" -mise_action_cache_setting() { +mise_step_settings() { awk ' - /uses: step-security\/mise-action@/ { in_step = 1; next } + /uses: / && in_step { exit } + /uses: SonarSource\/mise-action-wrapper@[0-9a-f]{40} # [0-9]/ { in_step = 1; print "wrapper"; next } in_step && /^ - / { exit } - in_step && /^ cache:/ { print $2; exit } + in_step && /^ cache:/ { print "cache=" $2 } ' "$1/action.yml" } +direct_mise_action_steps() { + grep -c 'uses: step-security/mise-action@' "$1/action.yml" || true +} + Describe 'mise data directory ownership' Parameters config-poetry @@ -16,8 +21,14 @@ Describe 'mise data directory ownership' config-npm End - It "keeps the mise cache of $1 disabled so it cannot overwrite a restored mise installation" - When call mise_action_cache_setting "$1" - The output should equal 'false' + It "installs the tools of $1 through the wrapper with its cache disabled" + When call mise_step_settings "$1" + The line 1 of output should equal 'wrapper' + The line 2 of output should equal 'cache=false' + End + + It "does not call step-security/mise-action directly in $1" + When call direct_mise_action_steps "$1" + The output should equal '0' End End