From 39328d0f1e775b58b8f3191aa242a5f03bc3a663 Mon Sep 17 00:00:00 2001 From: Thomas Boop Date: Thu, 6 May 2021 13:17:27 -0400 Subject: [PATCH 1/2] include urls in github context --- packages/github/src/context.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/github/src/context.ts b/packages/github/src/context.ts index 4eb7054310..8e60a65752 100644 --- a/packages/github/src/context.ts +++ b/packages/github/src/context.ts @@ -18,6 +18,9 @@ export class Context { job: string runNumber: number runId: number + apiUrl: string + serverUrl: string + graphqlUrl: string /** * Hydrate the context from the environment @@ -43,6 +46,9 @@ export class Context { this.job = process.env.GITHUB_JOB as string this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER as string, 10) this.runId = parseInt(process.env.GITHUB_RUN_ID as string, 10) + this.apiUrl = process.env.GITHUB_API_URL ?? "https://api.github.com" as string + this.serverUrl = process.env.GITHUB_SERVER_URL ?? "https://github.com" as string + this.graphqlUrl = process.env.GITHUB_GRAPHQL_URL ?? "https://api.github.com/graphql" as string } get issue(): {owner: string; repo: string; number: number} { From feb20eb17aefa83bf9812a3a81118b63fdc54c87 Mon Sep 17 00:00:00 2001 From: Thomas Boop Date: Thu, 6 May 2021 13:51:50 -0400 Subject: [PATCH 2/2] fix format --- packages/github/src/context.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/github/src/context.ts b/packages/github/src/context.ts index 8e60a65752..d3f65f7add 100644 --- a/packages/github/src/context.ts +++ b/packages/github/src/context.ts @@ -46,9 +46,10 @@ export class Context { this.job = process.env.GITHUB_JOB as string this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER as string, 10) this.runId = parseInt(process.env.GITHUB_RUN_ID as string, 10) - this.apiUrl = process.env.GITHUB_API_URL ?? "https://api.github.com" as string - this.serverUrl = process.env.GITHUB_SERVER_URL ?? "https://github.com" as string - this.graphqlUrl = process.env.GITHUB_GRAPHQL_URL ?? "https://api.github.com/graphql" as string + this.apiUrl = process.env.GITHUB_API_URL ?? `https://api.github.com` + this.serverUrl = process.env.GITHUB_SERVER_URL ?? `https://github.com` + this.graphqlUrl = + process.env.GITHUB_GRAPHQL_URL ?? `https://api.github.com/graphql` } get issue(): {owner: string; repo: string; number: number} {