Skip to content

Commit

Permalink
tools: include current release in the list of released versions
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
aduh95 authored and ruyadorno committed Nov 21, 2022
1 parent 00a3b5f commit 39e8731
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions tools/lint-md/list-released-versions-from-changelogs.mjs
Expand Up @@ -20,6 +20,8 @@ async function getVersionsFromFile(file) {
return;
} else if (toc && line.startsWith('<a')) {
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));
}
}
}
Expand All @@ -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(',')}`);

0 comments on commit 39e8731

Please sign in to comment.