From 499789684c9a0d41c9b3f0d66a785ba17b1d51ab Mon Sep 17 00:00:00 2001 From: GGG KILLER Date: Tue, 23 Nov 2021 10:58:49 -0300 Subject: [PATCH] Warn users when installing EOL .NET versions (#245) --- dist/index.js | 6 +++++- src/installer.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 74c9c1a..a210d87 100644 --- a/dist/index.js +++ b/dist/index.js @@ -18183,7 +18183,11 @@ class DotnetCoreInstaller { if (releasesInfo.length === 0) { throw new Error(`Could not find info for version ${versionParts.join('.')} at ${DotNetCoreIndexUrl}`); } - return releasesInfo[0]['releases.json']; + const releaseInfo = releasesInfo[0]; + if (releaseInfo['support-phase'] === 'eol') { + core.warning(`${releaseInfo['product']} ${releaseInfo['channel-version']} is no longer supported and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.`); + } + return releaseInfo['releases.json']; }); } } diff --git a/src/installer.ts b/src/installer.ts index 4251260..c25d23a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -285,7 +285,14 @@ export class DotnetCoreInstaller { ); } - return releasesInfo[0]['releases.json']; + const releaseInfo = releasesInfo[0]; + if (releaseInfo['support-phase'] === 'eol') { + core.warning( + `${releaseInfo['product']} ${releaseInfo['channel-version']} is no longer supported and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy.` + ); + } + + return releaseInfo['releases.json']; } private version: string;