From c316d579acff95cb0f02b76f367065b24a15562c Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 10:50:14 +0100 Subject: [PATCH 01/10] feat: move to sonarcloud --- .github/workflows/sonar.yaml | 48 --------------------- .github/workflows/sonarcloud.yml | 25 +++++++++++ packages/connector/sonar-project.properties | 4 +- packages/docs/sonar-project.properties | 4 +- packages/snap/sonar-project.properties | 4 +- packages/vcmanager/sonar-project.properties | 4 +- 6 files changed, 33 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/sonar.yaml create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml deleted file mode 100644 index 33e204378..000000000 --- a/.github/workflows/sonar.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Sonarqube Workflow - -on: - workflow_dispatch: - push: - branches: - - develop - pull_request: - types: [opened, synchronize, reopened] - -jobs: - sonarqube: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - uses: nrwl/nx-set-shas@v3 - with: - main-branch-name: 'develop' - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 7.25.1 - - uses: actions/setup-node@v3 - with: - node-version: 18.13.0 - cache: pnpm - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Test - run: pnpm run test:ci - env: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - - name: SonarQube Scan - run: ./scripts/sonar/run-sonar.sh - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - timeout-minutes: 30 - - services: - sonarqube: - image: sonarqube:8.9-community - ports: - - 9000:9000 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 000000000..f2be40cb5 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,25 @@ +name: SonarCloud +on: + workflow_dispatch: + push: + branches: + - master + - develop + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + with: > + -Dsonar.organization=blockchain-lab-um + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} diff --git a/packages/connector/sonar-project.properties b/packages/connector/sonar-project.properties index f80b64457..e6d20c414 100644 --- a/packages/connector/sonar-project.properties +++ b/packages/connector/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=connector -sonar.projectName=connector +sonar.projectKey=blockchain-lab-um_connector +sonar.projectName=blockchain-lab-um_connector sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts diff --git a/packages/docs/sonar-project.properties b/packages/docs/sonar-project.properties index 878cc7601..b8ec8e861 100644 --- a/packages/docs/sonar-project.properties +++ b/packages/docs/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=docs -sonar.projectName=docs +sonar.projectKey=blockchain-lab-um_docs +sonar.projectName=blockchain-lab-um_docs sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts diff --git a/packages/snap/sonar-project.properties b/packages/snap/sonar-project.properties index f6b217110..fce8bc88d 100644 --- a/packages/snap/sonar-project.properties +++ b/packages/snap/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=snap -sonar.projectName=snap +sonar.projectKey=blockchain-lab-um_snap +sonar.projectName=blockchain-lab-um_snap sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts diff --git a/packages/vcmanager/sonar-project.properties b/packages/vcmanager/sonar-project.properties index 261fccd6b..6caba2370 100644 --- a/packages/vcmanager/sonar-project.properties +++ b/packages/vcmanager/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=vcmanager -sonar.projectName=vcmanager +sonar.projectKey=blockchain-lab-um_vcmanager +sonar.projectName=blockchain-lab-um_vcmanager sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts From 085e5e691ab3a2743c8c65b315d51cf203fa31ec Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 10:52:36 +0100 Subject: [PATCH 02/10] fix: fixes workflow file --- .github/workflows/sonarcloud.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index f2be40cb5..35d7e0d09 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -18,8 +18,9 @@ jobs: fetch-depth: 0 - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master - with: > - -Dsonar.organization=blockchain-lab-um + with: + args: > + -Dsonar.organization=blockchain-lab-um env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} From e0f6d888e867cad23cf9005568bb28d71d9a84ba Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:00:16 +0100 Subject: [PATCH 03/10] fix: try to split projects --- .github/workflows/sonarcloud.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 35d7e0d09..38f3bc7f0 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -16,11 +16,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: SonarCloud Scan + - name: Scan Snap uses: SonarSource/sonarcloud-github-action@master with: - args: > - -Dsonar.organization=blockchain-lab-um + projectBaseDir: packages/snap env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} From f9b8986c66364144963cd70dcbd273af85247481 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:02:31 +0100 Subject: [PATCH 04/10] chore: add back organization --- .github/workflows/sonarcloud.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 38f3bc7f0..6270473a5 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -20,6 +20,8 @@ jobs: uses: SonarSource/sonarcloud-github-action@master with: projectBaseDir: packages/snap + args: > + -Dsonar.organization=blockchain-lab-um env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} From 0910cdae77a15a0ab5e9d9fdf9da531981d7df49 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:29:38 +0100 Subject: [PATCH 05/10] feat: split into seperate jobs --- .github/workflows/sonarcloud.yml | 109 ++++++++++++++++++++++++++++++- packages/vcmanager/package.json | 3 +- 2 files changed, 108 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 6270473a5..167b67ee1 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -9,14 +9,30 @@ on: types: [opened, synchronize, reopened] jobs: - sonarcloud: - name: SonarCloud + # Snap + sonarcloud-snap: + name: SonarCloud snap runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Scan Snap + - uses: nrwl/nx-set-shas@v3 + with: + main-branch-name: 'develop' + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7.25.1 + - uses: actions/setup-node@v3 + with: + node-version: 18.13.0 + cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Test snap + run: pnpm nx test:ci @blockchain-lab-um/ssi-snap + - name: Scan snap uses: SonarSource/sonarcloud-github-action@master with: projectBaseDir: packages/snap @@ -25,3 +41,90 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + + # VC Manager + sonarcloud-vcmanager: + name: SonarCloud VC Manager + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: nrwl/nx-set-shas@v3 + with: + main-branch-name: 'develop' + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7.25.1 + - uses: actions/setup-node@v3 + with: + node-version: 18.13.0 + cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Test snap + run: pnpm nx test:ci @blockchain-lab-um/veramo-vc-manager + - name: Scan VC Manager + uses: SonarSource/sonarcloud-github-action@master + with: + projectBaseDir: packages/vcmanager + args: > + -Dsonar.organization=blockchain-lab-um + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + + # Connector + sonarcloud-connector: + name: SonarCloud connector + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Scan connector + uses: SonarSource/sonarcloud-github-action@master + with: + projectBaseDir: packages/connector + args: > + -Dsonar.organization=blockchain-lab-um + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + + # Dapp + sonarcloud-dapp: + name: SonarCloud dapp + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Scan dapp + uses: SonarSource/sonarcloud-github-action@master + with: + projectBaseDir: packages/dapp + args: > + -Dsonar.organization=blockchain-lab-um + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + + # Docs + sonarcloud-docs: + name: SonarCloud docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Scan docs + uses: SonarSource/sonarcloud-github-action@master + with: + projectBaseDir: packages/docs + args: > + -Dsonar.organization=blockchain-lab-um + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} diff --git a/packages/vcmanager/package.json b/packages/vcmanager/package.json index 99c298c5e..fe9cd3413 100644 --- a/packages/vcmanager/package.json +++ b/packages/vcmanager/package.json @@ -20,7 +20,8 @@ "lint:eslint": "eslint .", "lint:prettier": "prettier . --check", "prepack": "pnpm build", - "test": "pnpm jest" + "test": "pnpm jest", + "test:ci": "pnpm run test --silent --coverage" }, "dependencies": { "@blockchain-lab-um/ssi-snap-types": "*", From 0be9e315efcf5a15c3158a699660aae3c9e280c5 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:33:41 +0100 Subject: [PATCH 06/10] fix: fixes workflow file --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 167b67ee1..fee497675 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -47,7 +47,7 @@ jobs: name: SonarCloud VC Manager runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: nrwl/nx-set-shas@v3 From ef1e7c3912e97d0a8f7ea77b63ddeeed0bdbb9e1 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:35:39 +0100 Subject: [PATCH 07/10] fix: add nx_cloud_access token --- .github/workflows/sonarcloud.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index fee497675..5945d8151 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -32,6 +32,8 @@ jobs: run: pnpm install --frozen-lockfile - name: Test snap run: pnpm nx test:ci @blockchain-lab-um/ssi-snap + env: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - name: Scan snap uses: SonarSource/sonarcloud-github-action@master with: @@ -65,6 +67,8 @@ jobs: run: pnpm install --frozen-lockfile - name: Test snap run: pnpm nx test:ci @blockchain-lab-um/veramo-vc-manager + env: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - name: Scan VC Manager uses: SonarSource/sonarcloud-github-action@master with: From 48984ab724e3ed4fded817bbc0ffc5f340247f20 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:36:43 +0100 Subject: [PATCH 08/10] chore: sonar-project to dapp --- packages/dapp/sonar-project.properties | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/dapp/sonar-project.properties diff --git a/packages/dapp/sonar-project.properties b/packages/dapp/sonar-project.properties new file mode 100644 index 000000000..b742f439a --- /dev/null +++ b/packages/dapp/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=blockchain-lab-um_dapp +sonar.projectName=blockchain-lab-um_dapp +sonar.sourceEncoding=UTF-8 +sonar.sources=src +sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts +sonar.test.inclusions=**/*spec.ts,**/*.e2e-spec.ts +sonar.javascript.lcov.reportPaths=coverage/lcov.info From 12016a29c839eb4062cffda4ee0e07dc556929c7 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:39:11 +0100 Subject: [PATCH 09/10] fix: fxies vc-manager sonar project key --- packages/vcmanager/sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vcmanager/sonar-project.properties b/packages/vcmanager/sonar-project.properties index 6caba2370..e0c1ae1c5 100644 --- a/packages/vcmanager/sonar-project.properties +++ b/packages/vcmanager/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=blockchain-lab-um_vcmanager -sonar.projectName=blockchain-lab-um_vcmanager +sonar.projectKey=blockchain-lab-um_vc-manager +sonar.projectName=blockchain-lab-um_vc-manager sonar.sourceEncoding=UTF-8 sonar.sources=src sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts From 7cd470576c908fc6464a500c819daa4f9640c6f9 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Fri, 24 Feb 2023 11:52:43 +0100 Subject: [PATCH 10/10] chore: remove old sonar scripts --- scripts/sonar/Dockerfile | 17 ------- scripts/sonar/cleanup.sh | 8 --- scripts/sonar/entrypoint.sh | 25 ---------- scripts/sonar/run-sonar.sh | 97 ------------------------------------- 4 files changed, 147 deletions(-) delete mode 100644 scripts/sonar/Dockerfile delete mode 100755 scripts/sonar/cleanup.sh delete mode 100755 scripts/sonar/entrypoint.sh delete mode 100755 scripts/sonar/run-sonar.sh diff --git a/scripts/sonar/Dockerfile b/scripts/sonar/Dockerfile deleted file mode 100644 index 5425bf9d7..000000000 --- a/scripts/sonar/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM sonarsource/sonar-scanner-cli:4.7 - -LABEL version="1.1.0" \ - repository="https://github.com/sonarsource/sonarqube-scan-action" \ - homepage="https://github.com/sonarsource/sonarqube-scan-action" \ - maintainer="SonarSource" \ - com.github.actions.name="SonarQube Scan" \ - com.github.actions.description="Scan your code with SonarQube to detect Bugs, Vulnerabilities and Code Smells in up to 27 programming languages!" \ - com.github.actions.icon="check" \ - com.github.actions.color="green" - - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -COPY cleanup.sh /cleanup.sh -RUN chmod +x /cleanup.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/scripts/sonar/cleanup.sh b/scripts/sonar/cleanup.sh deleted file mode 100755 index a2606ba33..000000000 --- a/scripts/sonar/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -e - -_tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1) -PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file") - -chown -R $PERM "${INPUT_PROJECTBASEDIR}/" diff --git a/scripts/sonar/entrypoint.sh b/scripts/sonar/entrypoint.sh deleted file mode 100755 index 88f61cd89..000000000 --- a/scripts/sonar/entrypoint.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -z "${SONAR_TOKEN}" ]]; then - echo "============================ WARNING ============================" - echo "Running this GitHub Action without SONAR_TOKEN is not recommended" - echo "============================ WARNING ============================" -fi - -if [[ -z "${SONAR_HOST_URL}" ]]; then - echo "This GitHub Action requires the SONAR_HOST_URL env variable." - exit 1 -fi - -if [[ -n "${SONAR_ROOT_CERT}" ]]; then - echo "Adding custom root certificate to java certificate store" - rm -f /tmp/tmpcert.pem - echo "${SONAR_ROOT_CERT}" > /tmp/tmpcert.pem - keytool -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias sonarqube -file /tmp/tmpcert.pem -fi - -unset JAVA_HOME - -sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} ${INPUT_ARGS} diff --git a/scripts/sonar/run-sonar.sh b/scripts/sonar/run-sonar.sh deleted file mode 100755 index a9761affc..000000000 --- a/scripts/sonar/run-sonar.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# Helper functions for coloring output. -info() { echo -e "\\e[36m$*\\e[0m"; } -error() { echo -e "\\e[31m✗ $*\\e[0m"; } -success() { echo -e "\\e[32m✔ $*\\e[0m"; } - -# Helper function to check if SonarQube is up and running. -check_sq_is_up() { - local statusCall="$(curl --silent --user admin:admin http://127.0.0.1:9000/api/system/status)" - local status="$(jq -r '.status' <<< "$statusCall")" - if [[ ! $? -eq 0 ]]; then - error "Failed to check if SonarQube is up and running." - exit 1 - fi - echo $status; -} - - -info "Build scanner action..." - -docker build --no-cache -t sonarsource/sonarqube-scan-action ./scripts/sonar/ -if [[ ! $? -eq 0 ]]; then - error "Failed to build the scanner action." - exit 1 -fi -success "Scanner action built." - -info "Find the network SonarQube is running on..." -network=$(docker network ls -f 'name=github_network' --format "{{.Name}}") -if [[ $network != "github_network_"* ]]; then - error "Failed to find the local Docker network." - exit 1 -fi -success "Found the network ($network)." - -info "Wait until SonarQube is up..." -sleep 10 -isUp=$(check_sq_is_up) -until [[ "$isUp" == "UP" ]]; do - sleep 1 - isUp=$(check_sq_is_up) -done -success "SonarQube is up and running." - -info "Generate a new token..." -tokenCall=$(curl --silent --user admin:admin -d "name=token" http://127.0.0.1:9000/api/user_tokens/generate) -token="$(jq -r '.token' <<< "$tokenCall")" -if [[ -z "$token" ]]; then - error "Failed to generate a new token." - exit 1 -fi -success "New token generated." - -info "Test fail-fast if SONAR_TOKEN is omitted..." -docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network sonarsource/sonarqube-scan-action -if [[ $? -eq 0 ]]; then - error "Should have failed fast." - exit 1 -fi -success "Correctly failed fast." - -info "Test fail-fast if SONAR_HOST_URL is omitted..." -docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env SONAR_TOKEN=$token sonarsource/sonarqube-scan-action -if [[ $? -eq 0 ]]; then - error "Should have failed fast." - exit 1 -fi -success "Correctly failed fast." - -info "Analyze projects..." -# Loop over packages subdirectories. -for package in packages/*; do - dir="/github/workspace/${package%*/}" # remove the trailing "/" - if [[ -f "$package/sonar-project.properties" ]]; then - echo "Analyzing $package..." - docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env INPUT_PROJECTBASEDIR=$dir --env SONAR_TOKEN=$SONAR_TOKEN --env SONAR_HOST_URL=$SONAR_HOST_URL sonarsource/sonarqube-scan-action - docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env INPUT_PROJECTBASEDIR=$dir --entrypoint /cleanup.sh sonarsource/sonarqube-scan-action - if [[ ! $? -eq 0 ]]; then - error "Failed to analyze $package." - exit 1 - elif [[ ! -f "$package/.scannerwork/report-task.txt" ]]; then - error "Couldn't find the report task file. Analysis failed." - exit 1 - fi - else - echo "Skipping $package..." - fi - echo $dir -done - -success "Analysis successful." - -echo "" # new line -echo "============================" -echo "" # new line -success "QA successful!"