tools: include current release in the list of released versions

PR-URL: https://github.com/nodejs/node/pull/45463
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Antoine du Hamel 2022-11-14 17:58:58 -05:00 committed by GitHub
parent badc631d77
commit f2ee81839a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -107,7 +107,7 @@ jobs:
- name: Get release version numbers - name: Get release version numbers
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }} if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
id: get-released-versions 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 - name: Lint markdown files
run: | run: |
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"

View File

@ -20,6 +20,8 @@ async function getVersionsFromFile(file) {
return; return;
} else if (toc && line.startsWith('<a')) { } else if (toc && line.startsWith('<a')) {
result.push(line.slice(line.indexOf('>') + 1, -'</a><br/>'.length)); result.push(line.slice(line.indexOf('>') + 1, -'</a><br/>'.length));
} else if (toc && line.startsWith('<b><a')) {
result.push(line.slice(line.indexOf('>', 3) + 1, -'</a></b><br/>'.length));
} }
} }
} }
@ -30,11 +32,11 @@ const dir = await fs.promises.opendir(dataFolder);
for await (const dirent of dir) { for await (const dirent of dir) {
if (dirent.isFile()) { if (dirent.isFile()) {
filesToCheck.push( filesToCheck.push(
getVersionsFromFile(new URL(`./${dirent.name}`, dataFolder)) getVersionsFromFile(new URL(dirent.name, dataFolder))
); );
} }
} }
await Promise.all(filesToCheck); await Promise.all(filesToCheck);
console.log(`::set-output name=NODE_RELEASED_VERSIONS::${result.join(',')}`); console.log(`NODE_RELEASED_VERSIONS=${result.join(',')}`);