JobAlwaysRunsOnWindows returns true if the only OS that this job runs on is Windows.
(job *actionlint.Job)
| 223 | |
| 224 | // JobAlwaysRunsOnWindows returns true if the only OS that this job runs on is Windows. |
| 225 | func JobAlwaysRunsOnWindows(job *actionlint.Job) (bool, error) { |
| 226 | jobOSes, err := GetOSesForJob(job) |
| 227 | if err != nil { |
| 228 | return false, err |
| 229 | } |
| 230 | for _, os := range jobOSes { |
| 231 | if !strings.HasPrefix(strings.ToLower(os), windows) { |
| 232 | return false, nil |
| 233 | } |
| 234 | } |
| 235 | return true, nil |
| 236 | } |
| 237 | |
| 238 | // GetShellForStep returns the shell that is used to run the given step. |
| 239 | func GetShellForStep(step *actionlint.Step, job *actionlint.Job) (string, error) { |
no test coverage detected