Skip to content

Commit bc757c7

Browse files
authored
fix(coprocessor): skip coverage PR comment when diff is N/A (#2207)
fix(coprocessor): skip coverage PR comment when diff is N/A or no rust files changed
1 parent 33e270f commit bc757c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/coprocessor-cargo-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ jobs:
241241
DIFF_PCT: ${{ steps.diff-cov.outputs.diff_pct }}
242242
run: |
243243
{
244-
echo '### Changed Lines Coverage'
245-
echo "Coverage of added/modified lines: **${DIFF_PCT}**"
244+
echo '### Coprocessor Changed Lines Coverage'
245+
echo "Coverage of added/modified lines in \`coprocessor\`: **${DIFF_PCT}**"
246246
echo ''
247247
if [ -f /tmp/diff-cover-report.md ]; then
248248
echo '<details><summary>Per-file breakdown</summary>'
@@ -254,7 +254,7 @@ jobs:
254254
} | tee -a "$GITHUB_STEP_SUMMARY" > /tmp/coverage-comment.md
255255
256256
- name: Post coverage comment on PR
257-
if: ${{ !cancelled() && github.event.pull_request.head.repo.full_name == github.repository }}
257+
if: ${{ !cancelled() && github.event.pull_request.head.repo.full_name == github.repository && steps.diff-cov.outputs.diff_pct != 'N/A' }}
258258
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
259259
with:
260260
path: /tmp/coverage-comment.md

0 commit comments

Comments
 (0)