Skip to content

Commit

Permalink
fixed #2983 and re-add code coverage comments to PRs (#3076)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyf19 authored Jan 5, 2025
1 parent f70de65 commit fd9be46
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,27 @@ jobs:
- name: Create code coverage report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.4.1
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura'
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura' -filefilters:'+src/**/*.cs'
- name: Write coverage to job summary
shell: bash
run: |
cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
# Temporarily disable commenting the coverage report
# echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV
# echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV
# echo "EOF" >> $GITHUB_ENV
echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV
echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# - name: Comment coverage in PR
# uses: actions/github-script@v7
# id: comment
# with:
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: process.env.COMMENT_CONTENT_ENV_VAR
# })
- name: Comment coverage in PR
uses: actions/github-script@v7
id: comment
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.COMMENT_CONTENT_ENV_VAR
})
# Run baseline package validation
- name: Pack
Expand Down

0 comments on commit fd9be46

Please sign in to comment.