Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ The selected URL also determines the matching Vault server and reader-token engi

The `build-*` actions authenticate to SonarQube Cloud (`sonar-platform: sqc-eu` or `sqc-us`, and the matching platforms of
`run-shadow-scans`) with the GitHub OIDC token of the job, through
[`sonarqube-auth-action`](https://github.com/SonarSource/sonarqube-auth-action), instead of with tokens stored in Vault.
The SonarQube Cloud URLs, and the URL and token of the `next` platform, are still read from Vault.
[`sonarqube-auth-action`](https://github.com/SonarSource/sonarqube-auth-action), instead of with Vault secrets.
The `next` platform still reads its URL and token from Vault.

Requirements for each SonarQube Cloud platform that is analyzed:

Expand All @@ -106,6 +106,10 @@ Requirements for each SonarQube Cloud platform that is analyzed:
organization has enabled trusted scanning for GitHub Actions.
- The `sonar.organization` and `sonar.projectKey` of the build match the project bound to the repository: the token only grants
access to that project.
- The scanner of the build resolves the SonarQube Cloud URL from the region: the actions pass `sonar.region=us` for `sqc-us` and no
`sonar.host.url` for `sqc-eu`. This requires the SonarScanner for Gradle 6.1+ (`org.sonarqube` plugin), which is the first version to
support regions. The SonarScanner for Maven is pinned by the action. A `sonar.host.url` set in the build of the project must
match the region, or be removed.
- The build, the tests and the analysis complete within 30 minutes. The token is requested right before the build and lasts 30
minutes, which is the delay the analysis report must be uploaded within.

Expand Down
4 changes: 0 additions & 4 deletions build-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ runs:
secrets: |
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next url | NEXT_URL;' || '' }}
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next token | NEXT_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}
development/kv/data/sign key | SIGN_KEY;
development/kv/data/sign passphrase | PGP_PASSPHRASE;
development/kv/data/sign key_id | SIGN_KEY_ID;
Expand Down Expand Up @@ -185,9 +183,7 @@ runs:
# yamllint enable rule:line-length
NEXT_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_URL || '' }}
NEXT_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_TOKEN || '' }}
SQC_EU_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_EU_URL || '' }}
SQC_EU_TOKEN: ${{ steps.sonar-auth.outputs.sqc-eu-token }}
SQC_US_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_US_URL || '' }}
SQC_US_TOKEN: ${{ steps.sonar-auth.outputs.sqc-us-token }}
ORG_GRADLE_PROJECT_signingKey: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SIGN_KEY || '' }}
ORG_GRADLE_PROJECT_signingPassword: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).PGP_PASSPHRASE || '' }}
Expand Down
15 changes: 9 additions & 6 deletions build-gradle/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
# - SONAR_PLATFORM: SonarQube primary platform (next, sqc-eu, sqc-us, or none). Use 'none' to skip sonar scans.
# - NEXT_URL: URL of SonarQube server for next platform
# - NEXT_TOKEN: Access token to send analysis reports to SonarQube for next platform
# - SQC_US_URL: URL of SonarQube server for sqc-us platform
# - SQC_US_TOKEN: Access token to send analysis reports to SonarQube for sqc-us platform
# - SQC_EU_URL: URL of SonarQube server for sqc-eu platform
# - SQC_EU_TOKEN: Access token to send analysis reports to SonarQube for sqc-eu platform
# - RUN_SHADOW_SCANS: If true, run sonar scanner on all 3 platforms. If false, run on the platform provided by SONAR_PLATFORM.
# When enabled, SONAR_PLATFORM is ignored.
Expand Down Expand Up @@ -124,10 +122,15 @@ build_gradle_args() {
args+=("-x" "test")
fi

# SonarQube analysis (orchestrator will provide SONAR_HOST_URL and SONAR_TOKEN)
if [[ -n "${SONAR_HOST_URL:-}" && -n "${SONAR_TOKEN:-}" ]]; then
# SonarQube analysis (orchestrator will provide SONAR_TOKEN, and SONAR_HOST_URL or SONAR_REGION)
if [[ -n "${SONAR_TOKEN:-}" ]]; then
args+=("sonar")
args+=("-Dsonar.host.url=$SONAR_HOST_URL")
if [[ -n "${SONAR_HOST_URL:-}" ]]; then
args+=("-Dsonar.host.url=$SONAR_HOST_URL")
fi
if [[ -n "${SONAR_REGION:-}" ]]; then
args+=("-Dsonar.region=$SONAR_REGION")
fi
args+=("-Dsonar.token=$SONAR_TOKEN")
args+=("-Dsonar.analysis.buildNumber=$BUILD_NUMBER")
args+=("-Dsonar.analysis.pipeline=$GITHUB_RUN_ID")
Expand Down Expand Up @@ -188,7 +191,7 @@ set_gradle_cmd() {
#
# This function is called BY THE ORCHESTRATOR (orchestrate_sonar_platforms)
# The orchestrator will:
# 1. Set SONAR_HOST_URL and SONAR_TOKEN for the current platform
# 1. Set SONAR_TOKEN, and SONAR_HOST_URL (next) or SONAR_REGION (sqc-us) for the current platform
# 2. Call this function to execute the actual scanner
# 3. Repeat for each platform (if shadow scanning enabled)
gradle_build_and_analyze() {
Expand Down
4 changes: 0 additions & 4 deletions build-maven/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ runs:
secrets: |
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next url | NEXT_URL;' || '' }}
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next token | NEXT_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}
development/kv/data/sign key | SIGN_KEY;
development/kv/data/sign passphrase | PGP_PASSPHRASE;
# yamllint enable rule:line-length
Expand Down Expand Up @@ -219,9 +217,7 @@ runs:
# yamllint enable rule:line-length
NEXT_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_URL || '' }}
NEXT_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_TOKEN || '' }}
SQC_EU_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_EU_URL || '' }}
SQC_EU_TOKEN: ${{ steps.sonar-auth.outputs.sqc-eu-token }}
SQC_US_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_US_URL || '' }}
SQC_US_TOKEN: ${{ steps.sonar-auth.outputs.sqc-us-token }}
SIGN_KEY: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SIGN_KEY || '' }}
PGP_PASSPHRASE: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).PGP_PASSPHRASE || '' }}
Expand Down
15 changes: 10 additions & 5 deletions build-maven/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
# - SONAR_PLATFORM: SonarQube primary platform (next, sqc-eu, sqc-us, or none). Use 'none' to skip sonar scans.
# - NEXT_URL: URL of SonarQube server for next platform
# - NEXT_TOKEN: Access token to send analysis reports to SonarQube for next platform
# - SQC_US_URL: URL of SonarQube server for sqc-us platform
# - SQC_US_TOKEN: Access token to send analysis reports to SonarQube for sqc-us platform
# - SQC_EU_URL: URL of SonarQube server for sqc-eu platform
# - SQC_EU_TOKEN: Access token to send analysis reports to SonarQube for sqc-eu platform
# - RUN_SHADOW_SCANS: If true, run sonar scanner on all 3 platforms. If false, run on the platform provided by SONAR_PLATFORM.
# - ARTIFACTORY_URL: URL to Artifactory repository
Expand Down Expand Up @@ -76,13 +74,20 @@ readonly SONAR_GOAL="org.sonarsource.scanner.maven:sonar-maven-plugin:${SCANNER_
# This function is called BY THE ORCHESTRATOR (orchestrate_sonar_platforms)
# INVERSION OF CONTROL: We implement this interface, orchestrator calls us
# The orchestrator will:
# 1. Set SONAR_HOST_URL and SONAR_TOKEN for the current platform
# 1. Set SONAR_TOKEN, and SONAR_HOST_URL (next) or SONAR_REGION (sqc-us) for the current platform
# 2. Call this function to execute the actual scanner
# 3. Repeat for each platform (if shadow scanning enabled)
sonar_scanner_implementation() {
local additional_params=("$@")
# Build sonar properties (using orchestrator-provided SONAR_HOST_URL/SONAR_TOKEN)
local sonar_props=("-Dsonar.host.url=${SONAR_HOST_URL}" "-Dsonar.token=${SONAR_TOKEN}")
# Build sonar properties (using orchestrator-provided SONAR_HOST_URL/SONAR_REGION/SONAR_TOKEN)
local sonar_props=()
if [[ -n "${SONAR_HOST_URL:-}" ]]; then
sonar_props+=("-Dsonar.host.url=${SONAR_HOST_URL}")
fi
if [[ -n "${SONAR_REGION:-}" ]]; then
sonar_props+=("-Dsonar.region=${SONAR_REGION}")
fi
sonar_props+=("-Dsonar.token=${SONAR_TOKEN}")
sonar_props+=("-Dsonar.projectVersion=${CURRENT_VERSION}")
sonar_props+=("${additional_params[@]+"${additional_params[@]}"}")

Expand Down
4 changes: 0 additions & 4 deletions build-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ runs:
secrets: |
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next url | NEXT_URL;' || '' }}
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next token | NEXT_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}
# yamllint enable rule:line-length
# The SonarQube Cloud tokens expire after 30 minutes: keep this step right before the build step.
- uses: ./.actions/shared/sonar-auth
Expand Down Expand Up @@ -182,9 +180,7 @@ runs:
SONAR_PLATFORM: ${{ inputs.sonar-platform }}
NEXT_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_URL || '' }}
NEXT_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_TOKEN || '' }}
SQC_EU_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_EU_URL || '' }}
SQC_EU_TOKEN: ${{ steps.sonar-auth.outputs.sqc-eu-token }}
SQC_US_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_US_URL || '' }}
SQC_US_TOKEN: ${{ steps.sonar-auth.outputs.sqc-us-token }}
JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR: ${{ runner.temp }}/jfrog-summary
# JFROG_CLI_GITHUB_TOKEN:
Expand Down
10 changes: 5 additions & 5 deletions build-npm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
# - SONAR_PLATFORM: SonarQube primary platform (next, sqc-eu, sqc-us, or none). Use 'none' to skip sonar scans.
# - NEXT_URL: URL of SonarQube server for next platform
# - NEXT_TOKEN: Access token to send analysis reports to SonarQube for next platform
# - SQC_US_URL: URL of SonarQube server for sqc-us platform
# - SQC_US_TOKEN: Access token to send analysis reports to SonarQube for sqc-us platform
# - SQC_EU_URL: URL of SonarQube server for sqc-eu platform
# - SQC_EU_TOKEN: Access token to send analysis reports to SonarQube for sqc-eu platform
# - RUN_SHADOW_SCANS: If true, run sonar scanner on all 3 platforms. If false, run on the platform provided by SONAR_PLATFORM.
# When enabled, SONAR_PLATFORM is ignored.
Expand Down Expand Up @@ -72,14 +70,16 @@ git_fetch_unshallow() {
#
# This function is called BY THE ORCHESTRATOR (orchestrate_sonar_platforms)
# The orchestrator will:
# 1. Set SONAR_HOST_URL and SONAR_TOKEN for the current platform
# 1. Set SONAR_TOKEN, and SONAR_HOST_URL (next) or SONAR_REGION (sqc-us) for the current platform
# 2. Call this function to execute the actual scanner
# 3. Repeat for each platform (if shadow scanning enabled)
sonar_scanner_implementation() {
local additional_params=("$@")
# Build base scanner arguments (using orchestrator-provided SONAR_HOST_URL/SONAR_TOKEN)
# Build base scanner arguments (using orchestrator-provided SONAR_HOST_URL/SONAR_REGION/SONAR_TOKEN)
local scanner_args=()
scanner_args+=("-Dsonar.host.url=${SONAR_HOST_URL}")
if [[ -n "${SONAR_HOST_URL:-}" ]]; then
scanner_args+=("-Dsonar.host.url=${SONAR_HOST_URL}")
fi
scanner_args+=("-Dsonar.token=${SONAR_TOKEN}")
scanner_args+=("-Dsonar.analysis.buildNumber=${BUILD_NUMBER}")
scanner_args+=("-Dsonar.analysis.pipeline=${GITHUB_RUN_ID}")
Expand Down
4 changes: 0 additions & 4 deletions build-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ runs:
secrets: |
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next url | NEXT_URL;' || '' }}
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next token | NEXT_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}
# yamllint enable rule:line-length
# The SonarQube Cloud tokens expire after 30 minutes: keep this step right before the build step.
- uses: ./.actions/shared/sonar-auth
Expand Down Expand Up @@ -168,8 +166,6 @@ runs:
POETRY_CACHE_DIR: ${{ github.workspace }}/${{ inputs.poetry-cache-dir }}

# Vault secrets
SQC_EU_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_EU_URL || '' }}
SQC_US_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_US_URL || '' }}
NEXT_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_URL || '' }}
NEXT_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_TOKEN || '' }}
SQC_EU_TOKEN: ${{ steps.sonar-auth.outputs.sqc-eu-token }}
Expand Down
19 changes: 12 additions & 7 deletions build-poetry/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# - SONAR_PLATFORM: SonarQube primary platform (next, sqc-eu, sqc-us, or none). Use 'none' to skip sonar scans.
# - NEXT_URL: URL of SonarQube server for next platform
# - NEXT_TOKEN: Access token to send analysis reports to SonarQube for next platform
# - SQC_US_URL: URL of SonarQube server for sqc-us platform
# - SQC_US_TOKEN: Access token to send analysis reports to SonarQube for sqc-us platform
# - SQC_EU_URL: URL of SonarQube server for sqc-eu platform
# - SQC_EU_TOKEN: Access token to send analysis reports to SonarQube for sqc-eu platform
# - RUN_SHADOW_SCANS: If true, run sonar scanner on all 3 platforms. If false, run on the platform provided by SONAR_PLATFORM.
# When enabled, SONAR_PLATFORM is ignored.
Expand Down Expand Up @@ -81,12 +79,12 @@ set_sonar_platform_vars() {
export SONAR_REGION=""
;;
"sqc-us")
export SONAR_HOST_URL="$SQC_US_URL"
unset SONAR_HOST_URL
export SONAR_TOKEN="$SQC_US_TOKEN"
export SONAR_REGION="us"
;;
"sqc-eu")
export SONAR_HOST_URL="$SQC_EU_URL"
unset SONAR_HOST_URL
export SONAR_TOKEN="$SQC_EU_TOKEN"
export SONAR_REGION=""
;;
Expand All @@ -100,22 +98,29 @@ set_sonar_platform_vars() {
;;
esac

echo "Using Sonar platform: $platform (URL: $SONAR_HOST_URL)"
echo "Using Sonar platform: $platform (URL: ${SONAR_HOST_URL:-default})"
}

run_sonar_scanner() {
local additional_params=("$@")
local location_args=()
if [[ -n "${SONAR_HOST_URL:-}" ]]; then
location_args+=("-Dsonar.host.url=${SONAR_HOST_URL}")
fi
if [[ -n "${SONAR_REGION:-}" ]]; then
location_args+=("-Dsonar.region=${SONAR_REGION}")
fi

# Install pysonar into Poetry's virtual environment without modifying project files
poetry run pip install pysonar
echo "Poetry command: poetry run pysonar ..." \
"-Dsonar.host.url=${SONAR_HOST_URL}" \
"${location_args[@]+${location_args[@]}}" \
"-Dsonar.analysis.buildNumber=${BUILD_NUMBER}" \
"-Dsonar.analysis.pipeline=${GITHUB_RUN_ID}" \
"-Dsonar.analysis.repository=${GITHUB_REPOSITORY}" \
"${additional_params[@]+${additional_params[@]}}"
poetry run pysonar \
-Dsonar.host.url="${SONAR_HOST_URL}" \
"${location_args[@]+${location_args[@]}}" \
-Dsonar.token="${SONAR_TOKEN}" \
-Dsonar.analysis.buildNumber="${BUILD_NUMBER}" \
-Dsonar.analysis.pipeline="${GITHUB_RUN_ID}" \
Expand Down
4 changes: 0 additions & 4 deletions build-yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ runs:
secrets: |
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next url | NEXT_URL;' || '' }}
${{ (inputs.sonar-platform == 'next' || inputs.run-shadow-scans == 'true') && 'development/kv/data/next token | NEXT_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}
# yamllint enable rule:line-length
# The SonarQube Cloud tokens expire after 30 minutes: keep this step right before the build step.
- uses: ./.actions/shared/sonar-auth
Expand Down Expand Up @@ -189,8 +187,6 @@ runs:
SKIP_TESTS: ${{ inputs.skip-tests }}

# Vault secrets
SQC_EU_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_EU_URL || '' }}
SQC_US_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).SQC_US_URL || '' }}
NEXT_URL: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_URL || '' }}
NEXT_TOKEN: ${{ steps.secrets.outputs.vault && fromJSON(steps.secrets.outputs.vault).NEXT_TOKEN || '' }}
SQC_EU_TOKEN: ${{ steps.sonar-auth.outputs.sqc-eu-token }}
Expand Down
10 changes: 5 additions & 5 deletions build-yarn/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
# - SONAR_PLATFORM: SonarQube primary platform (next, sqc-eu, sqc-us, or none). Use 'none' to skip sonar scans.
# - NEXT_URL: URL of SonarQube server for next platform
# - NEXT_TOKEN: Access token to send analysis reports to SonarQube for next platform
# - SQC_US_URL: URL of SonarQube server for sqc-us platform
# - SQC_US_TOKEN: Access token to send analysis reports to SonarQube for sqc-us platform
# - SQC_EU_URL: URL of SonarQube server for sqc-eu platform
# - SQC_EU_TOKEN: Access token to send analysis reports to SonarQube for sqc-eu platform
# - RUN_SHADOW_SCANS: If true, run sonar scanner on all 3 platforms. If false, run on the platform provided by SONAR_PLATFORM.
# When enabled, SONAR_PLATFORM is ignored.
Expand Down Expand Up @@ -143,14 +141,16 @@ set_project_version() {
#
# This function is called BY THE ORCHESTRATOR (orchestrate_sonar_platforms)
# The orchestrator will:
# 1. Set SONAR_HOST_URL and SONAR_TOKEN for the current platform
# 1. Set SONAR_TOKEN, and SONAR_HOST_URL (next) or SONAR_REGION (sqc-us) for the current platform
# 2. Call this function to execute the actual scanner
# 3. Repeat for each platform (if shadow scanning enabled)
sonar_scanner_implementation() {
local additional_params=("$@")
# Build base scanner arguments (using orchestrator-provided SONAR_HOST_URL/SONAR_TOKEN)
# Build base scanner arguments (using orchestrator-provided SONAR_HOST_URL/SONAR_REGION/SONAR_TOKEN)
local scanner_args=()
scanner_args+=("-Dsonar.host.url=${SONAR_HOST_URL}")
if [[ -n "${SONAR_HOST_URL:-}" ]]; then
scanner_args+=("-Dsonar.host.url=${SONAR_HOST_URL}")
fi
scanner_args+=("-Dsonar.token=${SONAR_TOKEN}")
scanner_args+=("-Dsonar.analysis.buildNumber=${BUILD_NUMBER}")
scanner_args+=("-Dsonar.analysis.pipeline=${GITHUB_RUN_ID}")
Expand Down
Loading
Loading