1
0
Fork 0

feat: add runAttempt to Context

pull/1387/head
Holden Whitehead 2023-03-27 13:36:51 -07:00
parent 457303960f
commit 3ceed57c65
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ export class Context {
actor: string actor: string
job: string job: string
runNumber: number runNumber: number
runAttempt: number
runId: number runId: number
apiUrl: string apiUrl: string
serverUrl: string serverUrl: string
@ -45,6 +46,7 @@ export class Context {
this.actor = process.env.GITHUB_ACTOR as string this.actor = process.env.GITHUB_ACTOR as string
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.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT 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.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`