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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
aduh95 authored and danielleadams committed Dec 28, 2022
1 parent df23829 commit ce7f655
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 ce7f655

Please sign in to comment.