1
0
Fork 0

Include urls in `@actions/github` context (#794)

* include urls in github context

* fix format
pull/800/head
Thomas Boop 2021-05-07 14:05:08 -04:00 committed by GitHub
parent ed490dc20d
commit 2b97eb3192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,9 @@ export class Context {
job: string job: string
runNumber: number runNumber: number
runId: number runId: number
apiUrl: string
serverUrl: string
graphqlUrl: string
/** /**
* Hydrate the context from the environment * Hydrate the context from the environment
@ -43,6 +46,10 @@ export class Context {
this.job = process.env.GITHUB_JOB as string this.job = process.env.GITHUB_JOB as string
this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER as string, 10) this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER as string, 10)
this.runId = parseInt(process.env.GITHUB_RUN_ID 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} { get issue(): {owner: string; repo: string; number: number} {