Repository navigation
BUILD-12715 Install config action tools through mise-action-wrapper with its cache disabled #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup step works out
ARTIFACTORY_READER_ROLEfrom theartifactory-reader-roleinput and writes it toGITHUB_ENV(config-npm line 82; config-poetry line 89 and config-uv line 90 do the same). The newSonarSource/mise-action-wrapperstep comes next, and it receives onlycache: false. The wrapper's action.yaml at 2.2.0 has a 'Set Artifactory reader role' step. That step reads only its ownartifactory_reader_roleinput, which is empty here. It falls back topublic-readerorprivate-readerbased on repository visibility and writes that value toGITHUB_ENV. This replaces the caller's role.The action's own
vault-action-wrapperstep runs after that and builds its secret path fromenv.ARTIFACTORY_READER_ROLE. So when a caller sets a customartifactory-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-actiondid not touch this variable.Related: the wrapper also runs with its defaults
repox_url=https://repox.jfrog.ioandvault_url=https://vault.sonar.build, so the action'srepox-urlselection (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).:
Was this helpful? React with 👍 / 👎