Merge pull request #20757 from backstage/rugvip/verify-links

scripts/verify-links: verify links in changesets
This commit is contained in:
Patrik Oldsberg
2023-10-24 16:10:47 +02:00
committed by GitHub
+8
View File
@@ -77,6 +77,10 @@ async function verifyUrl(basePath, absUrl, docPages) {
return undefined;
}
if (basePath.startsWith('.changeset/')) {
return { url, basePath, problem: 'out-of-changeset' };
}
let path = '';
if (url.startsWith('/')) {
@@ -195,6 +199,10 @@ async function main() {
'',
)}`,
);
} else if (problem === 'out-of-changeset') {
console.error('Links in changesets must use absolute URLs');
console.error(` From: ${basePath}`);
console.error(` To: ${url}`);
} else if (problem === 'doc-missing') {
const suggestion =
docPages.get(url) ||