Skip to content

Commit 168bcd6

Browse files
aravhawkclaudemaria-rcks
authored
fix(github): gh pr new links the new pull request to the thread (pingdotgg#33474)
Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent 8426595 commit 168bcd6

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/source-control-github/src/shared/definition.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ describe("GitHub change request URLs", () => {
9696
});
9797
});
9898

99+
describe("GitHub CLI commands", () => {
100+
it("recognizes shell pull request creates, including gh's `new` alias", () => {
101+
for (const command of ["gh pr create --fill", "gh pr new --fill"]) {
102+
expect(definition.changeRequestCreateCommand.test(command), command).toBe(true);
103+
}
104+
expect(definition.changeRequestCreateCommand.test("gh pr view 7")).toBe(false);
105+
});
106+
});
107+
99108
describe("GitHub repository pages", () => {
100109
it("leaves the tree route on other hosts to them", () => {
101110
expect(

‎packages/source-control-github/src/shared/definition.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ export const definition = defineSourceControl({
125125
] as const),
126126
checkoutCommand: ({ number }) => `gh pr checkout ${number}`,
127127
changeRequestCloseCommand: /\bgh\s+(?:pr\s+(?:merge|close)|stack\s+merge)\b/u,
128-
changeRequestCreateCommand: /\bgh\s+pr\s+create\b/u,
128+
// `new` is gh's alias for `create`.
129+
changeRequestCreateCommand: /\bgh\s+pr\s+(?:create|new)\b/u,
129130
authorProfileUrl: (login, repositoryUrl) =>
130131
login.endsWith("[bot]")
131132
? null

0 commit comments

Comments
 (0)