1
0
Fork 0

github: Add runAttempt

Adds the runAttempt variable to the context object for easier access

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
pull/1027/head
Eli Uriegas 2022-03-22 11:15:42 -07:00
parent d1abf7dc74
commit 0505405a3e
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export class Context {
job: string job: string
runNumber: number runNumber: number
runId: number runId: number
runAttempt: number
apiUrl: string apiUrl: string
serverUrl: string serverUrl: string
graphqlUrl: string graphqlUrl: string
@ -46,6 +47,7 @@ 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.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT as string, 10)
this.apiUrl = process.env.GITHUB_API_URL ?? `https://api.github.com` this.apiUrl = process.env.GITHUB_API_URL ?? `https://api.github.com`
this.serverUrl = process.env.GITHUB_SERVER_URL ?? `https://github.com` this.serverUrl = process.env.GITHUB_SERVER_URL ?? `https://github.com`
this.graphqlUrl = this.graphqlUrl =