Skip to content

Commit

Permalink
Add fwdproxy env vars for gh cli
Browse files Browse the repository at this point in the history
Reviewed By: muirdm

Differential Revision: D55261641

fbshipit-source-id: fd57a124c15be2631ea24a67edee0943cb4865d2
  • Loading branch information
evangrayk authored and facebook-github-bot committed Mar 22, 2024
1 parent 83055b4 commit 733a538
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions addons/isl-server/src/github/queryGraphQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {Internal} from '../Internal';
import {isExecaError} from '../utils';
import execa from 'execa';

Expand Down Expand Up @@ -38,7 +39,13 @@ export default async function queryGraphQL<TData, TVariables>(
args.push('-f', `query=${query}`);

try {
const {stdout} = await execa('gh', args, {stdout: 'pipe', stderr: 'pipe'});
const {stdout} = await execa('gh', args, {
stdout: 'pipe',
stderr: 'pipe',
env: {
...(Internal.additionalGhEnvVars ?? {}),
},
});
const json = JSON.parse(stdout);

if (Array.isArray(json.errors)) {
Expand Down Expand Up @@ -71,7 +78,13 @@ export async function isGithubEnterprise(hostname: string): Promise<boolean> {
args.push('--hostname', hostname);

try {
await execa('gh', args, {stdout: 'pipe', stderr: 'pipe'});
await execa('gh', args, {
stdout: 'pipe',
stderr: 'pipe',
env: {
...(Internal.additionalGhEnvVars ?? {}),
},
});
return true;
} catch {
return false;
Expand Down

0 comments on commit 733a538

Please sign in to comment.