Skip to content

Commit

Permalink
fix: check dir before using find (#14087)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt authored Aug 8, 2024
1 parent ebd45ce commit 3015b53
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,23 @@ jobs:
- name: Check and Set SonarQube Report Paths
shell: bash
run: |
sonarqube_tests_report_paths=$(find go_core_tests_logs -name output.txt | paste -sd "," -)
sonarqube_coverage_report_paths=$(find go_core_tests_logs -name coverage.txt | paste -sd "," -)
sonarqube_lint_report_paths=$(find golangci-lint-report -name golangci-lint-report.xml | paste -sd "," -)
# Check and assign paths for coverage/test reports
if [ -d "go_core_tests_logs" ]; then
sonarqube_coverage_report_paths=$(find go_core_tests_logs -name coverage.txt | paste -sd "," -)
sonarqube_tests_report_paths=$(find go_core_tests_logs -name output.txt | paste -sd "," -)
else
sonarqube_coverage_report_paths=""
sonarqube_tests_report_paths=""
fi
ARGS=""
# Check and assign paths for lint reports
if [ -d "golangci-lint-report" ]; then
sonarqube_lint_report_paths=$(find golangci-lint-report -name golangci-lint-report.xml | paste -sd "," -)
else
sonarqube_lint_report_paths=""
fi
ARGS=""
if [[ -z "$sonarqube_tests_report_paths" ]]; then
echo "::warning::No test report paths found, will not pass to sonarqube"
else
Expand Down

0 comments on commit 3015b53

Please sign in to comment.