Skip to content

Commit 2142fe2

Browse files
authored
chore: Add LTS info to the version durability document (RocketChat#36889)
1 parent d204ec6 commit 2142fe2

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/actions/update-version-durability/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Update Version Durability
22
description: Update Version Durability page on Document360
33

44
inputs:
5+
LTS_VERSIONS:
6+
required: true
7+
description: Comma separated list of LTS versions
8+
type: string
59
GH_TOKEN:
610
required: true
711
description: GitHub API Token

.github/actions/update-version-durability/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Octokit } from '@octokit/rest';
1212
const D360_TOKEN = core.getInput('D360_TOKEN');
1313
const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID');
1414
const PUBLISH = core.getInput('PUBLISH') === 'true';
15+
const LTS_VERSIONS = (core.getInput('LTS_VERSIONS') || '7.10').split(',').map((v) => v.trim());
1516

1617
const octokit = new Octokit({
1718
auth: core.getInput('GH_TOKEN'),
@@ -79,6 +80,11 @@ async function generateTable({ owner, repo } = {}) {
7980
continue;
8081
}
8182

83+
// Mark LTS
84+
if (LTS_VERSIONS.includes(`${currentVersion.major}.${currentVersion.minor}`)) {
85+
release.lts = true;
86+
}
87+
8288
index++;
8389
}
8490

@@ -97,7 +103,7 @@ async function generateTable({ owner, repo } = {}) {
97103
minorDate.setDate(1);
98104
supportDateStart = minorDate;
99105
supportDate = new Date(minorDate);
100-
supportDate.setMonth(supportDate.getMonth() + (lts ? 6 : 6));
106+
supportDate.setMonth(supportDate.getMonth() + (lts ? 9 : 6));
101107

102108
releaseData.push({
103109
release: {
@@ -145,7 +151,7 @@ async function generateTable({ owner, repo } = {}) {
145151
const endOfLife = !release.extendedSupport
146152
? 'TBD'
147153
: release.extendedSupport.end.toLocaleString('en', { month: 'short', year: "numeric" });
148-
const link = `${release.version} (<a href="${latestPatch.url}" target="_blank" translate="no">${latestPatch.version}</a>)`;
154+
const link = `${release.version}${release.lts ? " LTS" : ""} (<a href="${latestPatch.url}" target="_blank" translate="no">${latestPatch.version}</a>)`;
149155

150156
text.push(
151157
'<tr>',

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ jobs:
883883
- docker-image-publish
884884

885885
uses: ./.github/workflows/update-version-durability.yml
886+
with:
887+
LTS_VERSIONS: ${{ vars.LTS_VERSIONS }}
886888
secrets:
887889
CI_PAT: ${{ secrets.CI_PAT }}
888890
D360_TOKEN: ${{ secrets.D360_TOKEN }}

.github/workflows/update-version-durability.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Update Version Durability
33
on:
44
workflow_dispatch:
55
workflow_call:
6+
inputs:
7+
LTS_VERSIONS:
8+
required: false
9+
type: string
610
secrets:
711
CI_PAT:
812
required: true
@@ -29,6 +33,7 @@ jobs:
2933
- name: Update Version Durability
3034
uses: ./.github/actions/update-version-durability
3135
with:
36+
LTS_VERSIONS: ${{ inputs.LTS_VERSIONS != '' && inputs.LTS_VERSIONS || vars.LTS_VERSIONS }}
3237
GH_TOKEN: ${{ secrets.CI_PAT }}
3338
D360_TOKEN: ${{ secrets.D360_TOKEN }}
3439
D360_ARTICLE_ID: 800f8d52-409d-478d-b560-f82a2c0eb7fb

0 commit comments

Comments
 (0)