chore: Add LTS info to the version durability document (#36889)

pull/37079/head
Rodrigo Nascimento 3 months ago committed by GitHub
parent d204ec6eb1
commit 2142fe2201
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .github/actions/update-version-durability/action.yml
  2. 10
      .github/actions/update-version-durability/index.js
  3. 2
      .github/workflows/ci.yml
  4. 5
      .github/workflows/update-version-durability.yml

@ -2,6 +2,10 @@ name: Update Version Durability
description: Update Version Durability page on Document360
inputs:
LTS_VERSIONS:
required: true
description: Comma separated list of LTS versions
type: string
GH_TOKEN:
required: true
description: GitHub API Token

@ -12,6 +12,7 @@ import { Octokit } from '@octokit/rest';
const D360_TOKEN = core.getInput('D360_TOKEN');
const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID');
const PUBLISH = core.getInput('PUBLISH') === 'true';
const LTS_VERSIONS = (core.getInput('LTS_VERSIONS') || '7.10').split(',').map((v) => v.trim());
const octokit = new Octokit({
auth: core.getInput('GH_TOKEN'),
@ -79,6 +80,11 @@ async function generateTable({ owner, repo } = {}) {
continue;
}
// Mark LTS
if (LTS_VERSIONS.includes(`${currentVersion.major}.${currentVersion.minor}`)) {
release.lts = true;
}
index++;
}
@ -97,7 +103,7 @@ async function generateTable({ owner, repo } = {}) {
minorDate.setDate(1);
supportDateStart = minorDate;
supportDate = new Date(minorDate);
supportDate.setMonth(supportDate.getMonth() + (lts ? 6 : 6));
supportDate.setMonth(supportDate.getMonth() + (lts ? 9 : 6));
releaseData.push({
release: {
@ -145,7 +151,7 @@ async function generateTable({ owner, repo } = {}) {
const endOfLife = !release.extendedSupport
? 'TBD'
: release.extendedSupport.end.toLocaleString('en', { month: 'short', year: "numeric" });
const link = `${release.version} (<a href="${latestPatch.url}" target="_blank" translate="no">${latestPatch.version}</a>)`;
const link = `${release.version}${release.lts ? " LTS" : ""} (<a href="${latestPatch.url}" target="_blank" translate="no">${latestPatch.version}</a>)`;
text.push(
'<tr>',

@ -883,6 +883,8 @@ jobs:
- docker-image-publish
uses: ./.github/workflows/update-version-durability.yml
with:
LTS_VERSIONS: ${{ vars.LTS_VERSIONS }}
secrets:
CI_PAT: ${{ secrets.CI_PAT }}
D360_TOKEN: ${{ secrets.D360_TOKEN }}

@ -3,6 +3,10 @@ name: Update Version Durability
on:
workflow_dispatch:
workflow_call:
inputs:
LTS_VERSIONS:
required: false
type: string
secrets:
CI_PAT:
required: true
@ -29,6 +33,7 @@ jobs:
- name: Update Version Durability
uses: ./.github/actions/update-version-durability
with:
LTS_VERSIONS: ${{ inputs.LTS_VERSIONS != '' && inputs.LTS_VERSIONS || vars.LTS_VERSIONS }}
GH_TOKEN: ${{ secrets.CI_PAT }}
D360_TOKEN: ${{ secrets.D360_TOKEN }}
D360_ARTICLE_ID: 800f8d52-409d-478d-b560-f82a2c0eb7fb

Loading…
Cancel
Save