diff --git a/checks/packaging.go b/checks/packaging.go index c280151f..fae051e8 100644 --- a/checks/packaging.go +++ b/checks/packaging.go @@ -112,6 +112,11 @@ func isPackagingWorkflow(s string, fp string, c checker.Checker) bool { return true } + if strings.Contains(s, "docker push") { + c.Logf("found docker publishing workflow: %s", fp) + return true + } + c.Logf("!! not a packaging workflow: %s", fp) return false } diff --git a/e2e/packaging_test.go b/e2e/packaging_test.go index b92261e5..8204687a 100644 --- a/e2e/packaging_test.go +++ b/e2e/packaging_test.go @@ -26,5 +26,20 @@ var _ = Describe("E2E TEST:Packaging", func() { Expect(result.Error).Should(BeNil()) Expect(result.Pass).Should(BeTrue()) }) + It("Should return use of packaging in CI/CD for scorecard", func() { + l := log{} + checker := checker.Checker{ + Ctx: context.Background(), + Client: ghClient, + HttpClient: client, + Owner: "ossf", + Repo: "scorecard", + GraphClient: graphClient, + Logf: l.Logf, + } + result := checks.Packaging(checker) + Expect(result.Error).Should(BeNil()) + Expect(result.Pass).Should(BeTrue()) + }) }) })