@@ -53,7 +53,7 @@ const core = __importStar(__nccwpck_require__(7484));
53
53
const exec = __importStar(__nccwpck_require__(5236));
54
54
const fs = __importStar(__nccwpck_require__(9896));
55
55
const path = __importStar(__nccwpck_require__(6928));
56
- const VERSION = '5.4.11 ';
56
+ const VERSION = '5.4.12 ';
57
57
function run() {
58
58
return __awaiter(this, void 0, void 0, function* () {
59
59
try {
@@ -88,18 +88,30 @@ function run() {
88
88
core.info("Installing ReportGenerator global tool (https://www.nuget.org/packages/dotnet-reportgenerator-globaltool)");
89
89
output = '';
90
90
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
+ }
96
101
}
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;
97
111
}
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
+ }
103
115
}
104
116
core.info("Successfully installed ReportGenerator global tool");
105
117
}
0 commit comments