From f2ee81839ac00dcf234cb6940931e2c40b9b58ee Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 14 Nov 2022 17:58:58 -0500 Subject: [PATCH] tools: include current release in the list of released versions PR-URL: https://github.com/nodejs/node/pull/45463 Reviewed-By: Rafael Gonzaga Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Rich Trott --- .github/workflows/linters.yml | 2 +- tools/lint-md/list-released-versions-from-changelogs.mjs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 43724f9413d83a..c9b8f08f99e4a4 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -107,7 +107,7 @@ jobs: - name: Get release version numbers if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }} id: get-released-versions - run: ./tools/lint-md/list-released-versions-from-changelogs.mjs + run: ./tools/lint-md/list-released-versions-from-changelogs.mjs >> $GITHUB_OUTPUT - name: Lint markdown files run: | echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" diff --git a/tools/lint-md/list-released-versions-from-changelogs.mjs b/tools/lint-md/list-released-versions-from-changelogs.mjs index 52eb50d673e3a7..81b7d17197e7f9 100755 --- a/tools/lint-md/list-released-versions-from-changelogs.mjs +++ b/tools/lint-md/list-released-versions-from-changelogs.mjs @@ -20,6 +20,8 @@ async function getVersionsFromFile(file) { return; } else if (toc && line.startsWith('') + 1, -'
'.length)); + } else if (toc && line.startsWith('', 3) + 1, -'
'.length)); } } } @@ -30,11 +32,11 @@ const dir = await fs.promises.opendir(dataFolder); for await (const dirent of dir) { if (dirent.isFile()) { filesToCheck.push( - getVersionsFromFile(new URL(`./${dirent.name}`, dataFolder)) + getVersionsFromFile(new URL(dirent.name, dataFolder)) ); } } await Promise.all(filesToCheck); -console.log(`::set-output name=NODE_RELEASED_VERSIONS::${result.join(',')}`); +console.log(`NODE_RELEASED_VERSIONS=${result.join(',')}`);