Skip to content

Commit 57ef969

Browse files
committed
Update phpunit-coverage.yml
1 parent 4eebf4b commit 57ef969

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/phpunit-coverage.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
run: |
4545
# Run tests and capture coverage output
4646
coverage_output=$(npm run test-php-coverage -- --coverage-text)
47-
# Extract only the coverage report section and format it
48-
filtered_output=$(echo "$coverage_output" | sed -n '/^Code Coverage Report:/,$p' | sed '1 s/^/## /' | sed '/^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/d' | sed '/^Summary:/s/^/### /')
47+
# Extract only the coverage report section
48+
filtered_output=$(echo "$coverage_output" | sed -n '/^Summary:/,$p')
4949
echo "$filtered_output" | tee coverage-summary.txt
5050
echo "coverage_summary<<EOF" >> $GITHUB_ENV
5151
echo "$filtered_output" >> $GITHUB_ENV
@@ -57,12 +57,17 @@ jobs:
5757
with:
5858
issue-number: ${{ github.event.pull_request.number }}
5959
comment-author: 'github-actions[bot]'
60-
body-includes: Code Coverage Report
60+
body-includes: PHPUnit Coverage Report
6161

6262
- name: Create or Update Comment
6363
uses: peter-evans/create-or-update-comment@v3
6464
with:
6565
comment-id: ${{ steps.fc.outputs.comment-id }}
6666
issue-number: ${{ github.event.pull_request.number }}
67-
body: ${{ env.coverage_summary }}
67+
body: |
68+
## PHPUnit Coverage Report
69+
70+
```plaintext
71+
${{ env.coverage_summary }}
72+
```
6873
edit-mode: replace

0 commit comments

Comments
 (0)