fix: add ImageOS
env var based on running platform (#571)
This commit is contained in:
parent
09679f0156
commit
41b03b581c
1 changed files with 13 additions and 1 deletions
|
@ -576,8 +576,8 @@ func (rc *RunContext) withGithubEnv(env map[string]string) map[string]string {
|
|||
github := rc.getGithubContext()
|
||||
env["CI"] = "true"
|
||||
env["HOME"] = "/github/home"
|
||||
env["GITHUB_ENV"] = "/github/workflow/envs.txt"
|
||||
|
||||
env["GITHUB_ENV"] = "/github/workflow/envs.txt"
|
||||
env["GITHUB_WORKFLOW"] = github.Workflow
|
||||
env["GITHUB_RUN_ID"] = github.RunID
|
||||
env["GITHUB_RUN_NUMBER"] = github.RunNumber
|
||||
|
@ -594,6 +594,18 @@ func (rc *RunContext) withGithubEnv(env map[string]string) map[string]string {
|
|||
env["GITHUB_SERVER_URL"] = "https://github.com"
|
||||
env["GITHUB_API_URL"] = "https://api.github.com"
|
||||
env["GITHUB_GRAPHQL_URL"] = "https://api.github.com/graphql"
|
||||
|
||||
job := rc.Run.Job()
|
||||
if job.RunsOn() != nil {
|
||||
for _, runnerLabel := range job.RunsOn() {
|
||||
platformName := rc.ExprEval.Interpolate(runnerLabel)
|
||||
if platformName != "" {
|
||||
platformName = strings.SplitN(strings.Replace(platformName, `-`, ``, 1), `.`, 1)[0]
|
||||
env["ImageOS"] = platformName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return env
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue