Skip to content

Commit

Permalink
SCSCANGHA-24 Update the Docker base image to the latest minor 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Oct 3, 2024
1 parent eb21172 commit 8fb109a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,21 @@ jobs:
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.verbose=true"
overrideSonarcloudUrlTest:
name: >
'SONARCLOUD_URL' is used
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run action with debug mode
uses: ./
with:
args: -Dsonar.scanner.internal.dumpToFile=./output.properties
env:
SONARCLOUD_URL: "http://mirror.sonarcloud.io"
SONAR_TOKEN: FAKE_TOKEN
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.scanner.sonarcloudUrl=http://mirror.sonarcloud.io"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM sonarsource/sonar-scanner-cli:11.0
FROM sonarsource/sonar-scanner-cli:11.1

LABEL version="3.0.0" \
LABEL version="3.1.0" \
repository="https://github.com/sonarsource/sonarcloud-github-action" \
homepage="https://github.com/sonarsource/sonarcloud-github-action" \
maintainer="SonarSource" \
Expand Down
16 changes: 10 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e
set -eo pipefail

declare -a args=()

if [[ -z "${SONAR_TOKEN}" ]]; then
echo "Set the SONAR_TOKEN env variable."
Expand All @@ -17,14 +19,16 @@ if [[ -f "${INPUT_PROJECTBASEDIR%/}/build.gradle" || -f "${INPUT_PROJECTBASEDIR%
to get more accurate results."
fi

if [[ -z "${SONARCLOUD_URL}" ]]; then
SONARCLOUD_URL="https://sonarcloud.io"
if [[ -n "${SONARCLOUD_URL}" ]]; then
args+=("-Dsonar.scanner.sonarcloudUrl=${SONARCLOUD_URL}")
fi

debug_flag=''
if [[ "$RUNNER_DEBUG" == '1' ]]; then
debug_flag=' --debug '
args+=("--debug")
fi

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

args+=("-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR}")

sonar-scanner "${args[@]}" ${INPUT_ARGS}

0 comments on commit 8fb109a

Please sign in to comment.