Skip to content

Commit 1abb539

Browse files
fix: skip coverage grade comment on fork PRs (#14299)
1 parent c76c01e commit 1abb539

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/workflows/sonar-check.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ jobs:
7272
id: grade
7373
run: bash scripts/coverage-grade.sh client/target/site/jacoco-aggregate/jacoco.xml
7474
- name: Post Coverage Grade Comment on PR
75+
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
7576
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
7677
with:
7778
github-token: ${{ secrets.GITHUB_TOKEN }}
7879
script: |
7980
const grade = '${{ steps.grade.outputs.coverage_grade }}';
8081
const label = '${{ steps.grade.outputs.coverage_grade_label }}';
8182
const linePct = '${{ steps.grade.outputs.line_coverage }}';
82-
const branchPct = '${{ steps.grade.outputs.branch_coverage }}';
83+
const branchPct = '${{ steps.grade.outputs.branch_coverage || 'N/A' }}';
8384
const emojiMap = { A: '🟢', B: '🟡', C: '🟠', D: '🔴', F: '⛔' };
8485
const emoji = emojiMap[grade] ?? '❓';
8586
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;

0 commit comments

Comments
 (0)