Skip to content

Commit 8937a60

Browse files
committed
Fix URL format
1 parent 4233995 commit 8937a60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/github/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
} from './interface';
4040
import { IssueModel } from './issueModel';
4141
import { GHPRComment, GHPRCommentThread } from './prComment';
42+
import { PullRequestModel } from './pullRequestModel';
4243
import { RemoteInfo } from '../../common/types';
4344
import { Repository } from '../api/api';
4445
import { GitApiImpl } from '../api/api1';
@@ -1787,11 +1788,10 @@ export function vscodeDevPrLink(pullRequest: IssueModel) {
17871788
return `https://${vscode.env.appName.toLowerCase().includes('insider') ? 'insiders.' : ''}vscode.dev/github${itemUri.path}`;
17881789
}
17891790

1790-
export function codespacesPrLink(pullRequest: { head: GitHubRef }): string {
1791-
// GitHub Codespaces URL format: https://github.com/codespaces/new?ref={branch}&repo={owner/repo}
1792-
const repoFullName = `${pullRequest.head.owner}/${pullRequest.head.name}`;
1793-
const branch = pullRequest.head.ref;
1794-
return `https://github.com/codespaces/new?ref=${encodeURIComponent(branch)}&repo=${encodeURIComponent(repoFullName)}`;
1791+
export function codespacesPrLink(pullRequest: PullRequestModel): string {
1792+
const repoFullName = `${pullRequest.head!.owner}/${pullRequest.remote.repositoryName}`;
1793+
const branch = pullRequest.head!.ref;
1794+
return `https://github.com/codespaces/new/${encodeURIComponent(repoFullName)}/tree/${encodeURIComponent(branch)}`;
17951795
}
17961796

17971797
export function makeLabel(label: ILabel): string {

0 commit comments

Comments
 (0)