From 29b3d43988e1354519f667830eef06662cadd9e4 Mon Sep 17 00:00:00 2001 From: hackercat Date: Mon, 29 Mar 2021 06:46:09 +0200 Subject: [PATCH] fix: hardcode `ubuntu-latest` for `ImageOS` envvar (#579) Hardcode current `ubuntu-latest` since we have no way to check that 'on the fly' --- pkg/runner/run_context.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 5ba176d..25ea234 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -604,8 +604,13 @@ func (rc *RunContext) withGithubEnv(env map[string]string) map[string]string { for _, runnerLabel := range job.RunsOn() { platformName := rc.ExprEval.Interpolate(runnerLabel) if platformName != "" { - platformName = strings.SplitN(strings.Replace(platformName, `-`, ``, 1), `.`, 1)[0] - env["ImageOS"] = platformName + if platformName == "ubuntu-latest" { + // hardcode current ubuntu-latest since we have no way to check that 'on the fly' + env["ImageOS"] = "ubuntu20" + } else { + platformName = strings.SplitN(strings.Replace(platformName, `-`, ``, 1), `.`, 1)[0] + env["ImageOS"] = platformName + } } } }