From 531ea02fb9e40c512c8e9bdb0125c4950f172bb4 Mon Sep 17 00:00:00 2001 From: Bryan Naegele Date: Sun, 1 Aug 2021 09:39:39 -0600 Subject: [PATCH] Fix `ImageOS` format (#761) The current algorithm given `ubuntu-18.04` returns `ubuntu18.04` when it should be `ubuntu18` according to https://github.com/actions/virtual-environments/issues/345#issuecomment-581263296. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- pkg/runner/run_context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index c1431d6..985eed9 100755 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -707,7 +707,7 @@ func (rc *RunContext) withGithubEnv(env map[string]string) map[string]string { // 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] + platformName = strings.SplitN(strings.Replace(platformName, `-`, ``, 1), `.`, 2)[0] env["ImageOS"] = platformName } }