Skip to content

Commit 9305248

Browse files
committed
update
1 parent dae3f11 commit 9305248

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tools/pkg.pr.new-comment.mjs

+7-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ export default async function ({ github, context, output }) {
1414
const pullRequestNumber = await getPullRequestNumber();
1515

1616
const packages = output.packages.map((p) => {
17-
const normalizedUrl =
18-
pullRequestNumber && p.url.endsWith(sha)
19-
? `${p.url.slice(0, -sha.length)}${pullRequestNumber}`
20-
: p.url;
17+
let normalizedUrl = p.url;
18+
if (pullRequestNumber && p.url.endsWith(sha)) {
19+
normalizedUrl = `${p.url.slice(0, -sha.length)}${pullRequestNumber}`;
20+
}
21+
const repoPath = `/${context.repo.owner}/${context.repo.repo}/`;
22+
normalizedUrl = normalizedUrl.replace(repoPath, "/");
23+
2124
return {
2225
name: p.name,
2326
url: normalizedUrl,

0 commit comments

Comments
 (0)