1
1
mirror of https://github.com/nektos/act.git synced 2024-11-12 23:46:30 +03:00

fix: hardcode ubuntu-latest for ImageOS envvar (#579)

Hardcode current `ubuntu-latest` since we have no way to check that 'on the fly'
This commit is contained in:
hackercat 2021-03-29 06:46:09 +02:00 committed by GitHub
parent f3b53d8eca
commit 29b3d43988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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