Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c71dc039c | ||
|
|
ef211f93a6 | ||
|
|
74f62c995b | ||
|
|
c8aa051cc4 | ||
|
|
bfe63be746 | ||
|
|
2500896589 | ||
|
|
73bc64cb64 | ||
|
|
7d51dd28ef | ||
|
|
be0a85295f | ||
|
|
12d7d00f02 | ||
|
|
aa494459d7 | ||
|
|
1474b34972 | ||
|
|
961628671d | ||
|
|
f932b663ac | ||
|
|
550777f6eb |
@@ -1,4 +0,0 @@
|
||||
docker.projectNameFormat=repositoryNameAndTag
|
||||
docker.scanImages=true
|
||||
wss.url=https://saas-eu.whitesourcesoftware.com/agent
|
||||
productName=GitHubAction/SonarQubeScanAction
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
||||
.github/CODEOWNERS @sonarsource/orchestration-processing-squad
|
||||
.github/* @sonarsource/orchestration-processing-squad
|
||||
|
||||
7
.github/workflows/PullRequestClosed.yml
vendored
7
.github/workflows/PullRequestClosed.yml
vendored
@@ -5,16 +5,15 @@ on:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
PullRequestMerged_job:
|
||||
name: Pull Request Merged
|
||||
runs-on: ubuntu-latest
|
||||
PullRequestClosed_job:
|
||||
name: Pull Request Closed
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
id-token: write
|
||||
pull-requests: read
|
||||
# For external PR, ticket should be moved manually
|
||||
if: |
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
&& github.event.pull_request.merged
|
||||
steps:
|
||||
- id: secrets
|
||||
uses: SonarSource/vault-action-wrapper@v3
|
||||
|
||||
2
.github/workflows/PullRequestCreated.yml
vendored
2
.github/workflows/PullRequestCreated.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
PullRequestCreated_job:
|
||||
name: Pull Request Created
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
id-token: write
|
||||
# For external PR, ticket should be created manually
|
||||
|
||||
2
.github/workflows/RequestReview.yml
vendored
2
.github/workflows/RequestReview.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
RequestReview_job:
|
||||
name: Request review
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
id-token: write
|
||||
# For external PR, ticket should be moved manually
|
||||
|
||||
2
.github/workflows/SubmitReview.yml
vendored
2
.github/workflows/SubmitReview.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
SubmitReview_job:
|
||||
name: Submit Review
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
id-token: write
|
||||
pull-requests: read
|
||||
|
||||
2
.github/workflows/qa-deprecated-c-cpp.yml
vendored
2
.github/workflows/qa-deprecated-c-cpp.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
name: Action outputs
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
|
||||
os: [ubuntu-latest-large, windows-latest-large, macos-latest, macos-13]
|
||||
cache: [true, false]
|
||||
include:
|
||||
- arch: X64
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
name: Action outputs
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
|
||||
os: [ubuntu-latest-large, windows-latest-large, macos-latest, macos-13]
|
||||
cache: [true, false]
|
||||
include:
|
||||
- arch: X64
|
||||
|
||||
102
.github/workflows/qa-main.yml
vendored
102
.github/workflows/qa-main.yml
vendored
@@ -11,12 +11,15 @@ jobs:
|
||||
noInputsTest:
|
||||
name: >
|
||||
No inputs
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run action with args
|
||||
- name: Run action without args
|
||||
uses: ./
|
||||
env:
|
||||
SONAR_HOST_URL: http://not_actually_used
|
||||
@@ -29,7 +32,7 @@ jobs:
|
||||
'args' input
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -38,19 +41,45 @@ jobs:
|
||||
- name: Run action with args
|
||||
uses: ./
|
||||
with:
|
||||
args: -Dsonar.someArg=aValue -Dsonar.scanner.internal.dumpToFile=./output.properties
|
||||
args: -Dsonar.someArg=aValue -Dsonar.anotherArgWithSpaces="Another Value"
|
||||
env:
|
||||
SONAR_HOST_URL: http://not_actually_used
|
||||
SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}'
|
||||
- name: Assert
|
||||
run: |
|
||||
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
|
||||
./test/assertFileContains ./output.properties "sonar.anotherArgWithSpaces=Another Value"
|
||||
argsInputInjectionTest:
|
||||
name: >
|
||||
'args' input with command injection will fail
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run action with args
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
args: -Dsonar.someArg=aValue && echo "Injection"
|
||||
env:
|
||||
SONAR_HOST_URL: http://not_actually_used
|
||||
SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}'
|
||||
- name: Fail if action succeeded
|
||||
if: steps.runTest.outcome == 'success'
|
||||
run: exit 1
|
||||
- name: Assert the scanner was not called
|
||||
run: |
|
||||
./test/assertFileDoesntExist ./output.properties
|
||||
projectBaseDirInputTest:
|
||||
name: >
|
||||
'projectBaseDir' input
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -71,7 +100,7 @@ jobs:
|
||||
scannerVersionTest:
|
||||
name: >
|
||||
'scannerVersion' input
|
||||
runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64
|
||||
runs-on: ubuntu-latest-large # assumes default RUNNER_ARCH for linux is X64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -91,7 +120,7 @@ jobs:
|
||||
scannerBinariesUrlTest:
|
||||
name: >
|
||||
'scannerBinariesUrl' input with invalid URL
|
||||
runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64
|
||||
runs-on: ubuntu-latest-large # assumes default RUNNER_ARCH for linux is X64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -119,7 +148,7 @@ jobs:
|
||||
scannerBinariesUrlIsEscapedWithWget:
|
||||
name: >
|
||||
'scannerBinariesUrl' is escaped with wget so special chars are not injected in the download command
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -140,7 +169,7 @@ jobs:
|
||||
scannerBinariesUrlIsEscapedWithCurl:
|
||||
name: >
|
||||
'scannerBinariesUrl' is escaped with curl so special chars are not injected in the download command
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -169,7 +198,7 @@ jobs:
|
||||
dontFailGradleTest:
|
||||
name: >
|
||||
Don't fail on Gradle project
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -190,7 +219,7 @@ jobs:
|
||||
dontFailGradleKotlinTest:
|
||||
name: >
|
||||
Don't fail on Kotlin Gradle project
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -211,7 +240,7 @@ jobs:
|
||||
dontFailMavenTest:
|
||||
name: >
|
||||
Don't fail on Maven project
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -230,7 +259,7 @@ jobs:
|
||||
run: |
|
||||
./test/assertFileExists ./output.properties
|
||||
runAnalysisTest:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
services:
|
||||
sonarqube:
|
||||
image: sonarqube:lts-community
|
||||
@@ -265,7 +294,7 @@ jobs:
|
||||
'RUNNER_DEBUG' is used
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -283,7 +312,7 @@ jobs:
|
||||
run: |
|
||||
./test/assertFileContains ./output.properties "sonar.verbose=true"
|
||||
runAnalysisWithCacheTest:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
services:
|
||||
sonarqube:
|
||||
image: sonarqube:lts-community
|
||||
@@ -324,7 +353,7 @@ jobs:
|
||||
'SONARCLOUD_URL' is used
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -333,7 +362,7 @@ jobs:
|
||||
- name: Run action with SONARCLOUD_URL
|
||||
uses: ./
|
||||
with:
|
||||
args: -Dsonar.scanner.internal.dumpToFile=./output.properties
|
||||
args: -Dsonar.scanner.apiBaseUrl=api.mirror.sonarcloud.io -Dsonar.scanner.internal.dumpToFile=./output.properties
|
||||
env:
|
||||
SONARCLOUD_URL: mirror.sonarcloud.io
|
||||
SONAR_TOKEN: FAKE_TOKEN
|
||||
@@ -343,7 +372,7 @@ jobs:
|
||||
./test/assertFileContains ./output.properties "sonar.scanner.sonarcloudUrl=mirror.sonarcloud.io"
|
||||
dontFailWhenMissingWgetButCurlAvailable:
|
||||
name: Don't fail when missing wget but curl available
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -369,7 +398,7 @@ jobs:
|
||||
./test/assertFileExists ./output.properties
|
||||
dontFailWhenMissingCurlButWgetAvailable:
|
||||
name: Don't fail when missing curl but wget available
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -396,7 +425,7 @@ jobs:
|
||||
./test/assertFileExists ./output.properties
|
||||
failWhenBothWgetAndCurlMissing:
|
||||
name: Fail when both wget and curl are missing
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -429,7 +458,7 @@ jobs:
|
||||
curlPerformsRedirect:
|
||||
name: >
|
||||
curl performs redirect when scannerBinariesUrl returns 3xx
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -463,7 +492,7 @@ jobs:
|
||||
'SONAR_ROOT_CERT' is converted to truststore
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ ubuntu-latest-large, windows-latest-large, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -515,7 +544,7 @@ jobs:
|
||||
analysisWithSslCertificate:
|
||||
name: >
|
||||
Analysis takes into account 'SONAR_ROOT_CERT'
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -623,7 +652,7 @@ jobs:
|
||||
overridesScannerLocalFolderWhenPresent: # can happen in uncleaned self-hosted runners
|
||||
name: >
|
||||
'SCANNER_LOCAL_FOLDER' is cleaned with warning when present
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -657,7 +686,7 @@ jobs:
|
||||
updateTruststoreWhenPresent: # can happen in uncleaned self-hosted runners
|
||||
name: >
|
||||
truststore.p12 is updated when present
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -783,3 +812,26 @@ jobs:
|
||||
[ -f "$SONAR_SSL_FOLDER/truststore.p12" ] || exit 1
|
||||
TRUSTSTORE_P12_MOD_TIME_T3=$(stat -c %Y "$SONAR_SSL_FOLDER/truststore.p12")
|
||||
[ "$TRUSTSTORE_P12_MOD_TIME_T2" != "$TRUSTSTORE_P12_MOD_TIME_T3" ] || exit 1
|
||||
scannerVersionValidationTest:
|
||||
name: >
|
||||
'scannerVersion' input validation
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run action with invalid scannerVersion
|
||||
id: invalid_version
|
||||
uses: ./
|
||||
continue-on-error: true
|
||||
with:
|
||||
scannerVersion: "7.1.0-SNAPSHOT"
|
||||
args: -Dsonar.scanner.internal.dumpToFile=./output.properties
|
||||
env:
|
||||
NO_CACHE: true
|
||||
SONAR_HOST_URL: http://not_actually_used
|
||||
- name: Assert failure of previous step
|
||||
if: steps.invalid_version.outcome == 'success'
|
||||
run: |
|
||||
echo "Action with invalid scannerVersion should have failed but succeeded"
|
||||
exit 1
|
||||
|
||||
8
.github/workflows/qa-scripts.yml
vendored
8
.github/workflows/qa-scripts.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
jobs:
|
||||
create-install-dir-test:
|
||||
name: create_install_path.sh
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
grep "=== Script failed ===" output
|
||||
setup-script-test:
|
||||
name: configure_paths.sh
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
env:
|
||||
INSTALL_PATH: 'install-directory'
|
||||
SONAR_HOST_URL: 'http://sonar-host.com'
|
||||
@@ -250,7 +250,7 @@ jobs:
|
||||
grep "=== Script failed ===" output
|
||||
download-script-test:
|
||||
name: download.sh
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -319,7 +319,7 @@ jobs:
|
||||
grep "=== Script failed ===" output
|
||||
fetch-latest-version-test:
|
||||
name: fetch_latest_version.sh
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
4
.github/workflows/update-tags.yml
vendored
4
.github/workflows/update-tags.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Parse semver
|
||||
uses: madhead/semver-utils@v4
|
||||
uses: madhead/semver-utils@36d1e0ed361bd7b4b77665de8093092eaeabe6ba # v4.3.0
|
||||
id: version
|
||||
with:
|
||||
version: ${{ github.ref_name }}
|
||||
|
||||
52
.github/workflows/version_update.yml
vendored
52
.github/workflows/version_update.yml
vendored
@@ -5,12 +5,12 @@ on:
|
||||
- cron: '15 10 * * *'
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
name: Prepare pull request for sonar-scanner version update
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
check-version:
|
||||
name: Check for sonar-scanner version update
|
||||
runs-on: ubuntu-latest-large
|
||||
outputs:
|
||||
should_update: ${{ steps.version-check.outputs.should_update }}
|
||||
latest_version: ${{ steps.latest-version.outputs.latest }}
|
||||
steps:
|
||||
- run: sudo apt install -y jq
|
||||
- run: sudo snap install yq
|
||||
@@ -25,25 +25,43 @@ jobs:
|
||||
shell: bash
|
||||
run: cat sonar-scanner-version >> $GITHUB_OUTPUT
|
||||
|
||||
- name: "Fetch lastest sonar-scanner version"
|
||||
- name: "Fetch latest sonar-scanner version"
|
||||
id: latest-version
|
||||
shell: bash
|
||||
run: |
|
||||
./scripts/fetch_latest_version.sh > sonar-scanner-version
|
||||
cat sonar-scanner-version >> $GITHUB_OUTPUT
|
||||
- name: "Update default version"
|
||||
if: steps.tagged-version.outputs.sonar-scanner-version != steps.latest-version.outputs.sonar-scanner-version
|
||||
echo "latest=$(cat sonar-scanner-version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: "Determine if update is needed"
|
||||
id: version-check
|
||||
shell: bash
|
||||
env:
|
||||
NEW_VERSION: ${{ steps.latest-version.outputs.sonar-scanner-version }}
|
||||
run: |
|
||||
yq -i '.inputs.scannerVersion.default = "$NEW_VERSION"' action.yml
|
||||
- name: "Create Pull Request for version update"
|
||||
if: steps.tagged-version.outputs.sonar-scanner-version != steps.latest-version.outputs.sonar-scanner-version
|
||||
if [[ "${{ steps.tagged-version.outputs.sonar-scanner-version }}" != "${{ steps.latest-version.outputs.latest }}" ]]; then
|
||||
echo "should_update=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_update=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
update-version:
|
||||
name: Prepare pull request for sonar-scanner version update
|
||||
needs: check-version
|
||||
runs-on: ubuntu-latest-large
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: needs.check-version.outputs.should_update == 'true'
|
||||
steps:
|
||||
- name: "Update default version"
|
||||
shell: bash
|
||||
env:
|
||||
UPDATE_BRANCH: update-to-sonar-scanner-${{ steps.latest-version.outputs.sonar-scanner-version }}
|
||||
TITLE: "Update SonarScanner CLI to ${{ steps.latest-version.outputs.sonar-scanner-version }}"
|
||||
NEW_VERSION: ${{ needs.check-version.outputs.latest-version }}
|
||||
run: |
|
||||
yq -i '.inputs.scannerVersion.default = strenv(NEW_VERSION)' action.yml
|
||||
- name: "Create Pull Request for version update"
|
||||
shell: bash
|
||||
env:
|
||||
UPDATE_BRANCH: update-to-sonar-scanner-${{ needs.check-version.outputs.latest-version }}
|
||||
TITLE: "Update SonarScanner CLI to ${{ needs.check-version.outputs.latest-version }}"
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name "SonarTech"
|
||||
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
- name: Install Build Wrapper
|
||||
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@<action version>
|
||||
env:
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
|
||||
- name: Run Build Wrapper
|
||||
run: |
|
||||
# Here goes your compilation wrapped with Build Wrapper
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
uses: SonarSource/sonarqube-scan-action@<action version>
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
|
||||
SONAR_ROOT_CERT: ${{ secrets.SONAR_ROOT_CERT }}
|
||||
with:
|
||||
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
|
||||
|
||||
10
action.yml
10
action.yml
@@ -1,7 +1,7 @@
|
||||
name: Official SonarQube Scan
|
||||
# Warning: changing name would change URL in the marketplace
|
||||
description: >
|
||||
Scan your code with SonarQube Server and Cloud to detect issues in 30+ languages. (Formerly SonarQube and SonarCloud)
|
||||
Scan your code with SonarQube Server and Cloud to detect issues in 30+ languages. (Formerly SonarQube and SonarCloud)
|
||||
|
||||
branding:
|
||||
icon: check
|
||||
@@ -17,7 +17,7 @@ inputs:
|
||||
description: Version of the Sonar Scanner CLI to use
|
||||
required: false
|
||||
# to be kept in sync with sonar-scanner-version
|
||||
default: 7.0.2.4839
|
||||
default: 7.2.0.5079
|
||||
scannerBinariesUrl:
|
||||
description: URL to download the Sonar Scanner CLI binaries from
|
||||
required: false
|
||||
@@ -30,6 +30,7 @@ runs:
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_PROJECTBASEDIR: ${{ inputs.projectBaseDir }}
|
||||
INPUT_SCANNERVERSION: ${{ inputs.scannerVersion }}
|
||||
- name: Load Sonar Scanner CLI from cache
|
||||
id: sonar-scanner-cli
|
||||
uses: actions/cache@v4
|
||||
@@ -50,7 +51,10 @@ runs:
|
||||
run: echo "${RUNNER_TEMP}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/bin" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
- name: Run SonarScanner
|
||||
run: ${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner-cli.sh ${{ inputs.args }}
|
||||
run: |
|
||||
args=(${{ inputs.args }})
|
||||
cmd=(${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner-cli.sh "${args[@]}")
|
||||
"${cmd[@]}"
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_PROJECTBASEDIR: ${{ inputs.projectBaseDir }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -n "${SONAR_ROOT_CERT}" ]]; then
|
||||
echo "Adding custom root certificate to java certificate store"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ ${ARCH} != "X64" && ! (${ARCH} == "ARM64" && (${OS} == "macOS" || ${OS} == "Linux")) ]]; then
|
||||
echo "::error::Architecture '${ARCH}' is unsupported by build-wrapper"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$(dirname -- "$0")/utils.sh"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$(dirname -- "$0")/utils.sh"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$(dirname -- "$0")/utils.sh"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
@@ -77,5 +77,5 @@ scanner_args+=("$@")
|
||||
|
||||
set -ux
|
||||
|
||||
$SCANNER_BIN "${scanner_args[@]}"
|
||||
$SCANNER_BIN ${scanner_args[@]+"${scanner_args[@]}"}
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
if [[ ! "${INPUT_SCANNERVERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "::error title=SonarScanner::Invalid scannerVersion format. Expected format: x.y.z.w (e.g., 7.1.0.4889)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${SONAR_TOKEN}" ]]; then
|
||||
echo "::warning title=SonarScanner::Running this GitHub Action without SONAR_TOKEN is not recommended"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
check_status() {
|
||||
exit_status=$?
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
sonar-scanner-version=7.0.2.4839
|
||||
sonar-scanner-url-windows-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-windows-x64.zip
|
||||
sonar-scanner-sha-windows-x64=ecb5410e607e171fc43be4246f31e5432d796ac85372a5e68d6a8210197f5ca1
|
||||
sonar-scanner-url-linux-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-linux-x64.zip
|
||||
sonar-scanner-sha-linux-x64=87f80a41ad861c3d0eb2c00a1268e77ab5f93b83c17c816318ddecb0911baeb0
|
||||
sonar-scanner-url-linux-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-linux-aarch64.zip
|
||||
sonar-scanner-sha-linux-aarch64=567b391cb0e94c16fef558de909851a1a5b332f337f09ce12f863d7b3c633908
|
||||
sonar-scanner-url-macosx-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-macosx-x64.zip
|
||||
sonar-scanner-sha-macosx-x64=221be67f88f4fcbc464a7946879062a82f392a6c9a676d3a7eaa5c299df3894c
|
||||
sonar-scanner-url-macosx-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-macosx-aarch64.zip
|
||||
sonar-scanner-sha-macosx-aarch64=4106d482c00935817feda88466b64d2c02718277c31a5323f1984f8610f3ac45
|
||||
sonar-scanner-version=7.2.0.5079
|
||||
sonar-scanner-url-windows-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-windows-x64.zip
|
||||
sonar-scanner-sha-windows-x64=71936f352206b63cb05ffbcd68e366e52d22916148cf4a2418789bc776f733ea
|
||||
sonar-scanner-url-linux-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-linux-x64.zip
|
||||
sonar-scanner-sha-linux-x64=da9f4e64a3d555f08ce38b5469ebd91fe2b311af473f7001a5ee5c1fd58b004b
|
||||
sonar-scanner-url-linux-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-linux-aarch64.zip
|
||||
sonar-scanner-sha-linux-aarch64=803ca725d463e95eeb7537515706367bb8e52bf05ac32174daf9773bdb36d1e2
|
||||
sonar-scanner-url-macosx-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-macosx-x64.zip
|
||||
sonar-scanner-sha-macosx-x64=7b9e92248ca740fff41503bfe5459c460bac43c501d80043cc4fbebb72dfc5fa
|
||||
sonar-scanner-url-macosx-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-macosx-aarch64.zip
|
||||
sonar-scanner-sha-macosx-aarch64=c8adb3fbfe5485c17de193a217be765b66cbc10d6540057655afa3c3b5be6f61
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
error() { echo -e "\\e[31m✗ $*\\e[0m"; }
|
||||
|
||||
assertFileExists $1
|
||||
scriptDir=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
|
||||
|
||||
if ! grep -q $2 $1; then
|
||||
$scriptDir/assertFileExists "$1"
|
||||
|
||||
if ! grep -q "$2" "$1"; then
|
||||
error "'$2' not found in '$1'"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
error() { echo -e "\\e[31m✗ $*\\e[0m"; }
|
||||
|
||||
if [ -f $1 ]; then
|
||||
if [ -f "$1" ]; then
|
||||
error "File '$1' found"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
error() { echo -e "\\e[31m✗ $*\\e[0m"; }
|
||||
|
||||
if [ ! -f $1 ]; then
|
||||
if [ ! -f "$1" ]; then
|
||||
error "File '$1' not found"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user