Skip to content

[releases.json] Clear original date when promoting a preview release to rtm #5881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/update-releases-json/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function addNewReleaseVersion(releasePayload, supportedFrameworks, releasesData)

const [majorVersion, minorVersion, patchVersion, iteration] = actionUtils.splitVersionTag(releasePayload.tag_name);
const releaseMajorMinorVersion = `${majorVersion}.${minorVersion}`;
const isRTMRelease = (iteration === undefined);

// See if we're updating a release
let existingRelease = releasesData.releases[releaseMajorMinorVersion];
Expand All @@ -59,15 +60,18 @@ function addNewReleaseVersion(releasePayload, supportedFrameworks, releasesData)
};

// Preserve the original minor release date and out-of-support date for RTM releases
if (existingRelease !== undefined && iteration === undefined) {
if (existingRelease !== undefined &&
actionUtils.isVersionTagRTM(existingRelease.tag) &&
isRTMRelease) {

newRelease.minorReleaseDate = existingRelease.minorReleaseDate;
newRelease.outOfSupportDate = existingRelease.outOfSupportDate;
}

releasesData.releases[releaseMajorMinorVersion] = newRelease;

// Check if we're going to be putting a version out-of-support.
if (minorVersion > 0 && patchVersion === 0 && iteration === undefined) {
if (minorVersion > 0 && patchVersion === 0 && isRTMRelease) {
const endOfSupportDate = new Date(releaseDate.valueOf());
endOfSupportDate.setMonth(endOfSupportDate.getMonth() + releasesData.policy.additionalMonthsOfSupportOnNewMinorRelease);

Expand Down