From 9b3950b7cb02a7ade857ca8de1551b5fe049e991 Mon Sep 17 00:00:00 2001 From: HyukjinKwon Date: Mon, 5 Oct 2020 17:13:16 +0900 Subject: [PATCH] Don't run the test report in case of no JUnit XML files --- .github/workflows/test_report.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test_report.yml b/.github/workflows/test_report.yml index 93cdb8668726..060a8795b6a7 100644 --- a/.github/workflows/test_report.yml +++ b/.github/workflows/test_report.yml @@ -15,7 +15,16 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: ${{ github.event.workflow_run.workflow_id }} commit: ${{ github.event.workflow_run.head_commit.id }} + - name: Check if JUnit report XML files exist + run: | + if ls **/target/test-reports/*.xml > /dev/null 2>&1; then + echo '::set-output name=FILE_EXISTS::true' + else + echo '::set-output name=FILE_EXISTS::false' + fi + id: check-junit-file - name: Publish test report + if: steps.check-junit-file.outputs.FILE_EXISTS == 'true' uses: scacap/action-surefire-report@v1 with: check_name: Report test results