Skip to content

Commit c4c5175

Browse files
committed
5.4.12
1 parent 5359398 commit c4c5175

File tree

5 files changed

+28
-16
lines changed

5 files changed

+28
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The more advanced settings are documented in the [wiki](https://github.com/danie
1414
dotnet-quality: 'ga'
1515

1616
- name: ReportGenerator
17-
uses: danielpalme/[email protected].11
17+
uses: danielpalme/[email protected].12
1818
with:
1919
reports: 'coverage.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
2020
targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved.

dist/index.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const core = __importStar(__nccwpck_require__(7484));
5353
const exec = __importStar(__nccwpck_require__(5236));
5454
const fs = __importStar(__nccwpck_require__(9896));
5555
const path = __importStar(__nccwpck_require__(6928));
56-
const VERSION = '5.4.11';
56+
const VERSION = '5.4.12';
5757
function run() {
5858
return __awaiter(this, void 0, void 0, function* () {
5959
try {
@@ -88,18 +88,30 @@ function run() {
8888
core.info("Installing ReportGenerator global tool (https://www.nuget.org/packages/dotnet-reportgenerator-globaltool)");
8989
output = '';
9090
resultCode = 0;
91-
try {
92-
resultCode = yield exec.exec('dotnet', ['tool', 'install', 'dotnet-reportgenerator-globaltool', '--tool-path', toolpath, '--version', VERSION, '--ignore-failed-sources'], {
93-
listeners: {
94-
stdout: (data) => {
95-
output += data.toString();
91+
const maxRetries = 3;
92+
let attempt = 0;
93+
let success = false;
94+
while (attempt < maxRetries && !success) {
95+
try {
96+
resultCode = yield exec.exec('dotnet', ['tool', 'install', 'dotnet-reportgenerator-globaltool', '--tool-path', toolpath, '--version', VERSION, '--ignore-failed-sources'], {
97+
listeners: {
98+
stdout: (data) => {
99+
output += data.toString();
100+
}
96101
}
102+
});
103+
success = true;
104+
}
105+
catch (error) {
106+
attempt++;
107+
core.info(`Attempt ${attempt} to install ReportGenerator failed.`);
108+
if (attempt >= maxRetries) {
109+
core.setFailed("Failed to install ReportGenerator global tool after multiple attempts");
110+
return;
97111
}
98-
});
99-
}
100-
catch (error) {
101-
core.setFailed("Failed to install ReportGenerator global tool");
102-
return;
112+
core.info("Retrying in 10 seconds...");
113+
yield new Promise(resolve => setTimeout(resolve, 10000));
114+
}
103115
}
104116
core.info("Successfully installed ReportGenerator global tool");
105117
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ReportGenerator",
3-
"version": "5.4.11",
3+
"version": "5.4.12",
44
"description": "",
55
"main": "lib/reportgenerator.js",
66
"scripts": {

src/reportgenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as exec from '@actions/exec';
33
import * as fs from 'fs';
44
import * as path from 'path';
55

6-
const VERSION = '5.4.11';
6+
const VERSION = '5.4.12';
77

88
async function run() {
99
try {

0 commit comments

Comments
 (0)