Skip to content

Commit 9ea95c1

Browse files
parmartejassTejas Parmarmaria-rcks
authored
fix(gitlab): keep pull request actions on the selected host (#23695)
Co-authored-by: Tejas Parmar <[email protected]> Co-authored-by: maria-rcks <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent bef663a commit 9ea95c1

4 files changed

Lines changed: 260 additions & 30 deletions

File tree

‎packages/source-control-gitlab/src/server/GitLabCli.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export class GitLabCli extends Context.Service<
267267
{
268268
readonly execute: (input: {
269269
readonly cwd: string;
270+
readonly host?: string | undefined;
270271
readonly args: ReadonlyArray<string>;
271272
readonly timeoutMs?: number;
272273
/** Keeps sensitive payloads out of argv. */
@@ -432,6 +433,8 @@ export const make = Effect.gen(function* () {
432433
command: "glab",
433434
args: input.args,
434435
cwd: input.cwd,
436+
// glab may otherwise prefer a different checkout remote.
437+
...(input.host === undefined ? {} : { env: { GITLAB_HOST: input.host } }),
435438
classifyFailure: classifyGlabFailure,
436439
notFoundDetail: "Merge request not found.",
437440
timeoutMs: input.timeoutMs ?? DEFAULT_TIMEOUT_MS,

0 commit comments

Comments
 (0)