From e4bc44c6a3ca92b9b5cc64af08fc5115a11a8c6e Mon Sep 17 00:00:00 2001 From: getzze Date: Sun, 24 Nov 2024 16:38:22 +0000 Subject: [PATCH] Post coverage comment only on Pull_request (#1193) --- .github/workflows/CI.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9ed8f961..f3a4fd3f 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -192,13 +192,16 @@ jobs: - name: Coverage comment id: coverage_comment + if: github.event_name == 'pull_request' uses: py-cov-action/python-coverage-comment-action@v3 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Store Pull Request comment to be posted uses: actions/upload-artifact@v4 - if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' + if: | + github.event_name == 'pull_request' + && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' with: name: python-coverage-comment-action path: python-coverage-comment-action.txt