Skip to content

Commit cd1d4a6

Browse files
committed
Update workflow to check for secrets before trying to publish coverages
1 parent 4eaccd6 commit cd1d4a6

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,27 @@ jobs:
5353
name: code-coverage-report
5454
path: .coverage
5555

56+
check-secret:
57+
runs-on: ubuntu-latest
58+
outputs:
59+
secrets-exist: ${{ steps.check-for-secrets.outputs.defined }}
60+
steps:
61+
- name: Check for Secret availability
62+
id: check-for-secrets
63+
# perform secret check & put boolean result as an output
64+
shell: bash
65+
run: |
66+
if [ "${{ secrets.CC_TEST_REPORTER_ID }}" != '' ]; then
67+
echo "defined=true" >> $GITHUB_OUTPUT;
68+
else
69+
echo "defined=false" >> $GITHUB_OUTPUT;
70+
fi
71+
5672
coverage:
5773
name: Publish coverage
58-
needs: build
74+
needs: [build, check-secret]
5975
runs-on: ubuntu-latest
76+
if: needs.check-secret.outputs.secrets-exist == 'true'
6077

6178
steps:
6279
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)