Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ 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
Comment on lines +88 to +91

@gitar-bot gitar-bot Bot Dec 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Wrapper overwrites custom ARTIFACTORY_READER_ROLE before the Vault step

The setup step works out ARTIFACTORY_READER_ROLE from the artifactory-reader-role input and writes it to GITHUB_ENV (config-npm line 82; config-poetry line 89 and config-uv line 90 do the same). The new SonarSource/mise-action-wrapper step comes next, and it receives only cache: false. The wrapper's action.yaml at 2.2.0 has a 'Set Artifactory reader role' step. That step reads only its own artifactory_reader_role input, which is empty here. It falls back to public-reader or private-reader based on repository visibility and writes that value to GITHUB_ENV. This replaces the caller's role.

The action's own vault-action-wrapper step runs after that and builds its secret path from env.ARTIFACTORY_READER_ROLE. So when a caller sets a custom artifactory-reader-role, the role is now silently ignored. The npm, poetry or uv credentials are fetched for the default role, and the Vault lookup or later Artifactory access can fail. The overwritten value also stays in the job env after the config action finishes. Before this PR, step-security/mise-action did not touch this variable.

Related: the wrapper also runs with its defaults repox_url=https://repox.jfrog.io and vault_url=https://vault.sonar.build, so the action's repox-url selection (Edge on self-hosted runners, the dev Vault for .dev.sonar.build) is not applied to the wrapper's own Vault/Repox calls.

Pass the resolved role (and the Repox/Vault endpoints) to the wrapper so it writes back the same value (same change in config-poetry and config-uv).:

- uses: SonarSource/mise-action-wrapper@058f4c006a2dd0dc3152f37d019bae6c65093b59 # 2.2.0
  if: steps.config-npm-completed.outputs.skip != 'true'
  with:
    cache: false
    artifactory_reader_role: ${{ env.ARTIFACTORY_READER_ROLE }}
    repox_url: ${{ inputs.repox-url }}
    vault_url: ${{ contains(inputs.repox-url, '.dev.sonar.build') && 'https://vault.dev.sonar.build' || 'https://vault.sonar.build' }}

Was this helpful? React with 👍 / 👎


- uses: SonarSource/vault-action-wrapper@a7fa5fd4a4e4e0f2593f6137c0812cac196cf4ce # 3.7.0
if: steps.config-npm-completed.outputs.skip != 'true'
Expand Down
4 changes: 2 additions & 2 deletions config-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ 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
if: steps.config-poetry-completed.outputs.skip != 'true'
Expand Down
4 changes: 2 additions & 2 deletions config-uv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ 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
if: steps.config-uv-completed.outputs.skip != 'true'
Expand Down
34 changes: 34 additions & 0 deletions spec/mise-cache-owner_spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
eval "$(shellspec - -c) exit 1"

mise_step_settings() {
awk '
/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 "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
config-uv
config-npm
End

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
Loading