Browse Source

Fix variable naming from recent update (#452)

pull/453/head
Matt Andreko 2 months ago committed by GitHub
parent
commit
d92f49bd36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 48
      .github/workflows/_sonar.yml

48
.github/workflows/_sonar.yml

@ -103,30 +103,30 @@ jobs: @@ -103,30 +103,30 @@ jobs:
run: |
set -euo pipefail
ARGS=()
if [ -n "$_PULL_REQUEST_KEY" ]; then
ARGS+=("/d:sonar.pullrequest.key=$_PULL_REQUEST_KEY")
if [ -n "${_PULL_REQUEST_KEY}" ]; then
ARGS+=("/d:sonar.pullrequest.key=${_PULL_REQUEST_KEY}")
fi
if [ -n "$_SONAR_TEST_INCLUSIONS" ]; then
ARGS+=("/d:sonar.test.inclusions=$_SONAR_TEST_INCLUSIONS")
if [ -n "${_SONAR_TEST_INCLUSIONS}" ]; then
ARGS+=("/d:sonar.test.inclusions=${_SONAR_TEST_INCLUSIONS}")
fi
if [ -n "$_SONAR_EXCLUSIONS" ]; then
ARGS+=("/d:sonar.exclusions=$_SONAR_EXCLUSIONS")
if [ -n "${_SONAR_EXCLUSIONS}" ]; then
ARGS+=("/d:sonar.exclusions=${_SONAR_EXCLUSIONS}")
fi
if [ -n "$_SONAR_SOURCES" ]; then
ARGS+=("-Dsonar.sources=$_SONAR_SOURCES")
if [ -n "${_SONAR_SOURCES}" ]; then
ARGS+=("-Dsonar.sources=${_SONAR_SOURCES}")
fi
if [ -n "$_SONAR_TESTS" ]; then
ARGS+=("-Dsonar.tests=$_SONAR_TESTS")
if [ -n "${_SONAR_TESTS}" ]; then
ARGS+=("-Dsonar.tests=${_SONAR_TESTS}")
fi
dotnet-sonarscanner begin \
/k:"${REPOSITORY_OWNER}_${REPOSITORY_NAME}" \
/o:"$REPOSITORY_OWNER" \
/d:sonar.token="$SONAR_TOKEN" \
/k:"${_REPOSITORY_OWNER}_${_REPOSITORY_NAME}" \
/o:"${_REPOSITORY_OWNER}" \
/d:sonar.token="${_SONAR_TOKEN}" \
/d:sonar.host.url="https://sonarcloud.io" \
"${ARGS[@]}"
dotnet build
dotnet-sonarscanner end /d:sonar.token="$_SONAR_TOKEN"
dotnet-sonarscanner end /d:sonar.token="${_SONAR_TOKEN}"
- name: Scan with Sonar
if: inputs.sonar-config == 'maven'
@ -141,20 +141,20 @@ jobs: @@ -141,20 +141,20 @@ jobs:
set -euo pipefail
ARGS=()
if [ -n "$_SONAR_TEST_INCLUSIONS" ]; then
ARGS+=("-Dsonar.test.inclusions=$_SONAR_TEST_INCLUSIONS")
if [ -n "${_SONAR_TEST_INCLUSIONS}" ]; then
ARGS+=("-Dsonar.test.inclusions=${_SONAR_TEST_INCLUSIONS}")
fi
if [ -n "$_SONAR_EXCLUSIONS" ]; then
ARGS+=("-Dsonar.exclusions=$_SONAR_EXCLUSIONS")
if [ -n "${_SONAR_EXCLUSIONS}" ]; then
ARGS+=("-Dsonar.exclusions=${_SONAR_EXCLUSIONS}")
fi
if [ -n "$_SONAR_SOURCES" ]; then
ARGS+=("-Dsonar.sources=$_SONAR_SOURCES")
if [ -n "${_SONAR_SOURCES}" ]; then
ARGS+=("-Dsonar.sources=${_SONAR_SOURCES}")
fi
if [ -n "$_SONAR_TESTS" ]; then
ARGS+=("-Dsonar.tests=$_SONAR_TESTS")
if [ -n "${_SONAR_TESTS}" ]; then
ARGS+=("-Dsonar.tests=${_SONAR_TESTS}")
fi
if [ -n "$_PULL_REQUEST_KEY" ]; then
ARGS+=("-Dsonar.pullrequest.key=$_PULL_REQUEST_KEY")
if [ -n "${_PULL_REQUEST_KEY}" ]; then
ARGS+=("-Dsonar.pullrequest.key=${_PULL_REQUEST_KEY}")
fi
mvn clean install -Dgpg.skip=true sonar:sonar "${ARGS[@]}"

Loading…
Cancel
Save