1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

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>
This commit is contained in:
Bryan Naegele 2021-08-01 09:39:39 -06:00 committed by GitHub
parent f5835d4e56
commit b2d6b07d90

View file

@ -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
}
}