From 53de9c1c27c11bac42902183296f4c19e5d57b90 Mon Sep 17 00:00:00 2001 From: benniekiss Date: Mon, 31 Mar 2025 07:52:49 +0000 Subject: [PATCH] fix GOOS parsing to match expected GHA RUNNER_OS values (#106) This PR is a carryover from [upstream](https://github.com/nektos/act/pull/2422): > github actions reports RUNNER_OS for linux and windows with [capital letters](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#default-environment-variables) (Linux, Windows). This should increase compatibility when runner uses `-self-hosted` > > Currently, when workflows are run within containers, RUNNER_OS is [hardcoded](https://code.forgejo.org/forgejo/act/search/branch/main?path=&q=RUNNER_OS&mode=exact) to `Linux` correctly, so this will make RUNNER_OS more consistent. Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/106 Reviewed-by: Michael Kriese Reviewed-by: earl-warren Co-authored-by: benniekiss Co-committed-by: benniekiss --- act/container/host_environment.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/act/container/host_environment.go b/act/container/host_environment.go index 48b2a677..760e2c5e 100644 --- a/act/container/host_environment.go +++ b/act/container/host_environment.go @@ -473,7 +473,9 @@ func goArchToActionArch(arch string) string { func goOsToActionOs(os string) string { osMapper := map[string]string{ - "darwin": "macOS", + "linux": "Linux", + "windows": "Windows", + "darwin": "macOS", } if os, ok := osMapper[os]; ok { return os