mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-03 12:32:54 +08:00
Include urls in @actions/github context (#794)
* include urls in github context * fix format
This commit is contained in:
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…
x
Reference in New Issue
Block a user