Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: include current release in the list of released versions #45463

Merged
merged 1 commit into from Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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(',')}`);