1
0
Fork 0

Merge pull request #1588 from sshmaxime/main

Add RUN_ATTEMPT to `@actions/github` Context class
pull/1595/head
Tingluo Huang 2023-11-28 10:43:43 -05:00 committed by GitHub
commit 0787a93181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ export class Context {
action: string action: string
actor: string actor: string
job: string job: string
runAttempt: number
runNumber: number runNumber: number
runId: number runId: number
apiUrl: string apiUrl: string
@ -44,6 +45,7 @@ export class Context {
this.action = process.env.GITHUB_ACTION as string this.action = process.env.GITHUB_ACTION as string
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.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT as string, 10)
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.apiUrl = process.env.GITHUB_API_URL ?? `https://api.github.com`