Skip to content

Commit

Permalink
Include urls in @actions/github context (#794)
Browse files Browse the repository at this point in the history
* include urls in github context

* fix format
  • Loading branch information
thboop committed May 7, 2021
1 parent ed490dc commit 2b97eb3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/github/src/context.ts
Expand Up @@ -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
Expand All @@ -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} {
Expand Down

0 comments on commit 2b97eb3

Please sign in to comment.