@@ -53,7 +53,7 @@ const core = __importStar(__nccwpck_require__(7484));
5353const exec = __importStar(__nccwpck_require__(5236));
5454const fs = __importStar(__nccwpck_require__(9896));
5555const path = __importStar(__nccwpck_require__(6928));
56- const VERSION = '5.4.11 ';
56+ const VERSION = '5.4.12 ';
5757function 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 }
0 commit comments