|
|
|
|
@ -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[@]}" |
|
|
|
|
|