Skip to content

Commit f3ebfda

Browse files
committed
Steps/UploadCodeCoverage.yml: Conditionalize upload on codecov token presence
Some repos may not upload to codecov for various reasons. Those repos won't set the code coverage token so conditionalize the upload steps on the token. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent 61bd5b5 commit f3ebfda

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Steps/UploadCodeCoverage.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
##
1010

1111
parameters:
12-
- name: codecov_token
13-
displayName: Codecov.io Token
14-
type: string
15-
default: ''
1612
- name: report_dir
1713
displayName: Code Coverage Report
1814
type: string
@@ -31,9 +27,11 @@ steps:
3127
- script: |
3228
pip install requests
3329
displayName: Install Python Dependencies for Codecov Uploader
30+
condition: ne(variables['CODECOV_TOKEN'], '')
3431
3532
- task: PythonScript@0
3633
displayName: Download and Verify Codecov Uploader
34+
condition: ne(variables['CODECOV_TOKEN'], '')
3735
inputs:
3836
scriptSource: inline
3937
script: |
@@ -93,6 +91,7 @@ steps:
9391
9492
- task: PythonScript@0
9593
displayName: Run Codecov Uploader ${{ parameters.flag }}
94+
condition: ne(variables['CODECOV_TOKEN'], '')
9695
env:
9796
COV_FLAG: ${{ parameters.flag }}
9897
REPORT_DIR: ${{ parameters.report_dir }}

0 commit comments

Comments
 (0)