Skip to content

Commit

Permalink
Check for secrets on database test report upload (bitwarden#4984)
Browse files Browse the repository at this point in the history
  • Loading branch information
withinfocus authored Nov 6, 2024
1 parent 9beeeba commit d63e18e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/test-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit d63e18e

Please sign in to comment.