Skip to content

Commit d92f49b

Browse files
Fix variable naming from recent update (#452)
1 parent 55621d2 commit d92f49b

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

.github/workflows/_sonar.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,30 @@ jobs:
103103
run: |
104104
set -euo pipefail
105105
ARGS=()
106-
if [ -n "$_PULL_REQUEST_KEY" ]; then
107-
ARGS+=("/d:sonar.pullrequest.key=$_PULL_REQUEST_KEY")
106+
if [ -n "${_PULL_REQUEST_KEY}" ]; then
107+
ARGS+=("/d:sonar.pullrequest.key=${_PULL_REQUEST_KEY}")
108108
fi
109-
if [ -n "$_SONAR_TEST_INCLUSIONS" ]; then
110-
ARGS+=("/d:sonar.test.inclusions=$_SONAR_TEST_INCLUSIONS")
109+
if [ -n "${_SONAR_TEST_INCLUSIONS}" ]; then
110+
ARGS+=("/d:sonar.test.inclusions=${_SONAR_TEST_INCLUSIONS}")
111111
fi
112-
if [ -n "$_SONAR_EXCLUSIONS" ]; then
113-
ARGS+=("/d:sonar.exclusions=$_SONAR_EXCLUSIONS")
112+
if [ -n "${_SONAR_EXCLUSIONS}" ]; then
113+
ARGS+=("/d:sonar.exclusions=${_SONAR_EXCLUSIONS}")
114114
fi
115-
if [ -n "$_SONAR_SOURCES" ]; then
116-
ARGS+=("-Dsonar.sources=$_SONAR_SOURCES")
115+
if [ -n "${_SONAR_SOURCES}" ]; then
116+
ARGS+=("-Dsonar.sources=${_SONAR_SOURCES}")
117117
fi
118-
if [ -n "$_SONAR_TESTS" ]; then
119-
ARGS+=("-Dsonar.tests=$_SONAR_TESTS")
118+
if [ -n "${_SONAR_TESTS}" ]; then
119+
ARGS+=("-Dsonar.tests=${_SONAR_TESTS}")
120120
fi
121121
122122
dotnet-sonarscanner begin \
123-
/k:"${REPOSITORY_OWNER}_${REPOSITORY_NAME}" \
124-
/o:"$REPOSITORY_OWNER" \
125-
/d:sonar.token="$SONAR_TOKEN" \
123+
/k:"${_REPOSITORY_OWNER}_${_REPOSITORY_NAME}" \
124+
/o:"${_REPOSITORY_OWNER}" \
125+
/d:sonar.token="${_SONAR_TOKEN}" \
126126
/d:sonar.host.url="https://sonarcloud.io" \
127127
"${ARGS[@]}"
128128
dotnet build
129-
dotnet-sonarscanner end /d:sonar.token="$_SONAR_TOKEN"
129+
dotnet-sonarscanner end /d:sonar.token="${_SONAR_TOKEN}"
130130
131131
- name: Scan with Sonar
132132
if: inputs.sonar-config == 'maven'
@@ -141,20 +141,20 @@ jobs:
141141
set -euo pipefail
142142
ARGS=()
143143
144-
if [ -n "$_SONAR_TEST_INCLUSIONS" ]; then
145-
ARGS+=("-Dsonar.test.inclusions=$_SONAR_TEST_INCLUSIONS")
144+
if [ -n "${_SONAR_TEST_INCLUSIONS}" ]; then
145+
ARGS+=("-Dsonar.test.inclusions=${_SONAR_TEST_INCLUSIONS}")
146146
fi
147-
if [ -n "$_SONAR_EXCLUSIONS" ]; then
148-
ARGS+=("-Dsonar.exclusions=$_SONAR_EXCLUSIONS")
147+
if [ -n "${_SONAR_EXCLUSIONS}" ]; then
148+
ARGS+=("-Dsonar.exclusions=${_SONAR_EXCLUSIONS}")
149149
fi
150-
if [ -n "$_SONAR_SOURCES" ]; then
151-
ARGS+=("-Dsonar.sources=$_SONAR_SOURCES")
150+
if [ -n "${_SONAR_SOURCES}" ]; then
151+
ARGS+=("-Dsonar.sources=${_SONAR_SOURCES}")
152152
fi
153-
if [ -n "$_SONAR_TESTS" ]; then
154-
ARGS+=("-Dsonar.tests=$_SONAR_TESTS")
153+
if [ -n "${_SONAR_TESTS}" ]; then
154+
ARGS+=("-Dsonar.tests=${_SONAR_TESTS}")
155155
fi
156-
if [ -n "$_PULL_REQUEST_KEY" ]; then
157-
ARGS+=("-Dsonar.pullrequest.key=$_PULL_REQUEST_KEY")
156+
if [ -n "${_PULL_REQUEST_KEY}" ]; then
157+
ARGS+=("-Dsonar.pullrequest.key=${_PULL_REQUEST_KEY}")
158158
fi
159159
160160
mvn clean install -Dgpg.skip=true sonar:sonar "${ARGS[@]}"

0 commit comments

Comments
 (0)