diff --git a/action.yaml b/action.yaml
index 469b32e..59a8115 100644
--- a/action.yaml
+++ b/action.yaml
@@ -25,6 +25,11 @@ inputs:
required: false
default: 'delta-coverage'
+ additional-data:
+ description: 'Base path for HTML coverage reports (e.g., snapshot/backend/coverage/example-service/pr-2822/17153419223/).'
+ required: false
+ default: ''
+
outputs:
badges-dir:
description: 'Directory with generated badges.'
@@ -143,7 +148,8 @@ runs:
checkRunsContent: `${{ steps.create-check-runs.outputs.check-runs }}`,
commentTitle: '${{ inputs.title }}',
commentMarker: `${{ steps.comment-marker.outputs.result }}`,
- core: core
+ core: core,
+ additionalData: `${{ inputs.additional-data }}`
});
- name: Update or Create Comment
@@ -158,13 +164,15 @@ runs:
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: '${{ steps.find-comment.outputs.result }}',
- body: ${{ steps.build-message.outputs.result }}
+ body: ${{ steps.build-message.outputs.result }},
+ link: `${{ inputs.additional-data }}`
})
} else {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
- body: ${{ steps.build-message.outputs.result }}
+ body: ${{ steps.build-message.outputs.result }},
+ link: `${{ inputs.additional-data }}`
})
}
diff --git a/src/build-comment-body.js b/src/build-comment-body.js
index f1d9c33..f1c5298 100644
--- a/src/build-comment-body.js
+++ b/src/build-comment-body.js
@@ -69,6 +69,32 @@ module.exports = (ctx) => {
return ``;
}
+ const buildHtmlReportLink = (checkRun) => {
+ if (!ctx.additionalData || ctx.additionalData.trim() === '') return '';
+
+ let baseUrl = ctx.additionalData.trim();
+
+ if (baseUrl.endsWith('/')) {
+ baseUrl = baseUrl.slice(0, -1);
+ }
+
+ let viewPath = checkRun.view;
+ if (viewPath === 'functionalTest') {
+ viewPath = 'functional-test';
+ } else if (viewPath === 'integrationTest') {
+ viewPath = 'integration-test';
+ } else if (viewPath === 'unitTest') {
+ viewPath = 'unit-test';
+ } else if (viewPath === 'componentTest') {
+ viewPath = 'component-test';
+ } else if (viewPath === 'archUnitTest') {
+ viewPath = 'arch-unit-test';
+ }
+
+ const htmlUrl = `${baseUrl}/${viewPath}/html/index.html`;
+ return ` | 📊 HTML Report`;
+ };
+
const buildExpectedValue = (entityData) => {
return (entityData.expected > NO_VALUE) ? `🎯 ${entityData.expected}% 🎯` : '';
}
@@ -91,8 +117,9 @@ module.exports = (ctx) => {
const hasFailure = viewSummaryData.some(it => it.isFailed);
const statusSymbol = hasFailure ? '🔴' : '🟢';
+ const htmlReportLink = buildHtmlReportLink(checkRun);
const viewCellValue = `
-