mirror of https://github.com/actions/toolkit
Include urls in `@actions/github` context (#794)
* include urls in github context * fix formatpull/800/head
parent
ed490dc20d
commit
2b97eb3192
|
@ -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} {
|
||||||
|
|
Loading…
Reference in New Issue