Skip to content

[DOCS] Fix docs preview workflow URL generation logic #129608

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

Merged
merged 10 commits into from
Jun 18, 2025
6 changes: 3 additions & 3 deletions .github/workflows/docs-preview-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
!/(^|\/)_snippets\//i.test(f.filename)
)
.map(f => {
let p = f.filename.replace(/\/index\.md$/i, '/');
if (p === f.filename) p = p.replace(/\.md$/i, '');
let p = f.filename.replace(/^docs\//, '').replace(/\/index\.md$/i, '/');
if (p === f.filename.replace(/^docs\//, '')) p = p.replace(/\.md$/i, '');
return `- [\`${f.filename}\`](${base}/${p})`;
});
if (!links.length) return; // nothing to do
Expand Down Expand Up @@ -68,4 +68,4 @@ jobs:
issue_number: prNum,
body
});
}
}