Skip to content

Commit 856304c

Browse files
committed
Prevent code cov error on CI
1 parent a6a2048 commit 856304c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/coverage-comment.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ jobs:
1313
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1414
steps:
1515
- name: Download comment artifact
16+
id: download
1617
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
1718
with:
1819
name: pr-comment
1920
path: pr-comment/
2021
run_id: ${{ github.event.workflow_run.id }}
2122
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
# 2.x PR builds don't produce this artifact (coverage comment steps
24+
# only exist on 3.x), so don't fail when it's absent -- just skip.
25+
if_no_artifact_found: warn
2226

2327
- name: Post coverage comment
28+
if: ${{ steps.download.outputs.found_artifact == 'true' }}
2429
run: |
2530
PR_NUMBER=$(cat pr-comment/pr-number.txt)
2631
COMMENT_BODY=$(cat pr-comment/comment-body.txt)

0 commit comments

Comments
 (0)