Skip to content

Commit

Permalink
SCSCANGHA-16 Support passing args with spaces (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
istvan-bodo-sonarsource committed May 23, 2024
1 parent a69a8ed commit d08d592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
- name: Run action with args
uses: ./
with:
args: -Dsonar.someArg=aValue -Dsonar.scanner.dumpToFile=./output.properties
args: >-
"-Dsonar.someArg=a value with spaces" -Dsonar.scanner.dumpToFile=./output.properties
env:
SONAR_TOKEN: FAKE_TOKEN
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
./test/assertFileContains ./output.properties "sonar.someArg=a value with spaces"
projectBaseDirInputTest:
name: >
'projectBaseDir' input
Expand Down
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ if [[ "$RUNNER_DEBUG" == '1' ]]; then
fi

unset JAVA_HOME
sonar-scanner $debug_flag -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL} ${INPUT_ARGS}

eval "args=(${INPUT_ARGS})"
sonar-scanner $debug_flag "-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR}" "-Dsonar.host.url=${SONARCLOUD_URL}" "${args[@]}"

0 comments on commit d08d592

Please sign in to comment.