From 0ba864e9c2062186bcd6f5ed0a14784d40b38e86 Mon Sep 17 00:00:00 2001 From: Azeem Shaikh Date: Wed, 27 Oct 2021 12:24:02 -0700 Subject: [PATCH] Avoid panic in code (#1171) Co-authored-by: Azeem Shaikh --- checks/pinned_dependencies.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/pinned_dependencies.go b/checks/pinned_dependencies.go index 68fb15e9011..e415dfcf8cb 100644 --- a/checks/pinned_dependencies.go +++ b/checks/pinned_dependencies.go @@ -592,7 +592,9 @@ func getOSesForJob(job *gitHubActionWorkflowJob) ([]string, error) { if osVal, ok := m["os"]; ok { if oses, ok := osVal.([]interface{}); ok { for _, os := range oses { - jobOSes = append(jobOSes, os.(string)) + if strVal, ok := os.(string); ok { + jobOSes = append(jobOSes, strVal) + } } return jobOSes, nil }