From 41e41e0b1e3f78f8f5c65a770fa3194f2d44bad7 Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Wed, 6 Nov 2024 11:38:25 -0500 Subject: [PATCH] Check for secrets on database test report upload (#4984) --- .github/workflows/test-database.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-database.yml b/.github/workflows/test-database.yml index e16c080bc..f053e81a5 100644 --- a/.github/workflows/test-database.yml +++ b/.github/workflows/test-database.yml @@ -30,9 +30,28 @@ on: - "test/Infrastructure.IntegrationTest/**" # Any changes to the tests jobs: + check-test-secrets: + name: Check for test secrets + runs-on: ubuntu-22.04 + outputs: + available: ${{ steps.check-test-secrets.outputs.available }} + permissions: + contents: read + + steps: + - name: Check + id: check-test-secrets + run: | + if [ "${{ secrets.CODECOV_TOKEN }}" != '' ]; then + echo "available=true" >> $GITHUB_OUTPUT; + else + echo "available=false" >> $GITHUB_OUTPUT; + fi + test: name: Run tests runs-on: ubuntu-22.04 + needs: check-test-secrets steps: - name: Check out repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -128,7 +147,7 @@ jobs: - name: Report test results uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1 - if: always() + if: ${{ needs.check-test-secrets.outputs.available == 'true' && !cancelled() }} with: name: Test Results path: "**/*-test-results.trx"