Skip to content

Commit c1fca92

Browse files
committed
fix: missing report gen license
1 parent e3fa635 commit c1fca92

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ jobs:
8686
echo "${AFFECTED}" | tr ' ' '\n' >> $GITHUB_STEP_SUMMARY
8787
echo '```' >> $GITHUB_STEP_SUMMARY
8888
89-
- name: Run tests and generate coverage badges
89+
- name: Run tests
9090
env:
91-
REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
9291
CI: "true"
9392
run: |
9493
pnpm nx affected -t test \
@@ -97,11 +96,22 @@ jobs:
9796
--collect:"XPlat Code Coverage" \
9897
--settings coverlet.runsettings \
9998
--logger "console;verbosity=minimal"
100-
reportgenerator \
101-
"-reports:tests/**/TestResults/**/coverage.cobertura.xml" \
102-
"-targetdir:coverage-badges" \
103-
"-reporttypes:Badges" \
104-
"-verbosity:Warning"
99+
100+
- name: Generate coverage badges
101+
if: ${{ secrets.REPORTGENERATOR_LICENSE != '' }}
102+
env:
103+
REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
104+
run: |
105+
COVERAGE_FILES=$(find tests -name "coverage.cobertura.xml" 2>/dev/null | head -1)
106+
if [ -n "$COVERAGE_FILES" ]; then
107+
reportgenerator \
108+
"-reports:tests/**/TestResults/**/coverage.cobertura.xml" \
109+
"-targetdir:coverage-badges" \
110+
"-reporttypes:Badges" \
111+
"-verbosity:Warning"
112+
else
113+
echo "No coverage files found — skipping badge generation."
114+
fi
105115
106116
- name: Configure Git
107117
run: |

0 commit comments

Comments
 (0)