From 2d462c1a339c8b40c5cba47de5ca8a519ac296f7 Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Sat, 18 Nov 2023 03:15:28 +0000 Subject: [PATCH] Only upload report if build succeeds --- .github/workflows/build_pr.yml | 3 ++- .github/workflows/snapshot.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_pr.yml b/.github/workflows/build_pr.yml index 292ff71..3965144 100644 --- a/.github/workflows/build_pr.yml +++ b/.github/workflows/build_pr.yml @@ -17,6 +17,7 @@ jobs: with: cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') }} - name: Build + id: build run: | ./gradlew build - name: Publish @@ -33,7 +34,7 @@ jobs: ./gradlew test - name: Upload Test Report uses: actions/upload-artifact@v3 - if: success() || failure() + if: (success() || failure()) && steps.build.conclusion == 'success' with: name: junit-test-results path: "*/build/test-results/test/TEST-*.xml" diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 46270c0..caf1338 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -18,6 +18,7 @@ jobs: - uses: gradle/gradle-build-action@v2 name: Setup Gradle - name: Build + id: build run: | ./gradlew build - name: Publish @@ -34,7 +35,7 @@ jobs: ./gradlew test - name: Upload Test Report uses: actions/upload-artifact@v3 - if: success() || failure() + if: (success() || failure()) && steps.build.conclusion == 'success' with: name: junit-test-results path: "*/build/test-results/test/TEST-*.xml"