From 2b97eb3192ed27ad81a555e87f3f9de61c11a213 Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Fri, 7 May 2021 14:05:08 -0400 Subject: [PATCH] Include urls in `@actions/github` context (#794) * include urls in github context * fix format --- packages/github/src/context.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/github/src/context.ts b/packages/github/src/context.ts index 4eb7054310..d3f65f7add 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,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` + 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} {