MCPcopy
hub / github.com/ossf/scorecard / JobAlwaysRunsOnWindows

Function JobAlwaysRunsOnWindows

checks/fileparser/github_workflow.go:225–236  ·  view source on GitHub ↗

JobAlwaysRunsOnWindows returns true if the only OS that this job runs on is Windows.

(job *actionlint.Job)

Source from the content-addressed store, hash-verified

223
224// JobAlwaysRunsOnWindows returns true if the only OS that this job runs on is Windows.
225func 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.
239func GetShellForStep(step *actionlint.Step, job *actionlint.Job) (string, error) {

Callers 1

GetShellForStepFunction · 0.85

Calls 1

GetOSesForJobFunction · 0.85

Tested by

no test coverage detected