From 101f130b8021cac516817b3839fd43777debd51f Mon Sep 17 00:00:00 2001 From: Tianxing Jiang Date: Mon, 24 May 2021 12:37:34 -0400 Subject: [PATCH] Add action to comment on PR (#8) * Add action to comment on PR * Allow repeats --- .github/workflows/coverage.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a835d4f9..58beec0c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: build +name: Report coverage on: push: @@ -40,3 +40,13 @@ jobs: run: | echo "coverage = ${{ steps.jacoco.outputs.coverage }}" echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" + + - name: Add comment to PR + uses: mshick/add-pr-comment@v1 + if: ${{ github.event_name == 'pull_request' }} + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + allow-repeats: true + message: 'Statement coverage = ${{ steps.jacoco.outputs.coverage }} + + Branch coverage = ${{ steps.jacoco.outputs.branches }}'