From 4bdc15801818e255dfa08230647da053ead79fe1 Mon Sep 17 00:00:00 2001 From: naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Fri, 12 Feb 2021 16:25:11 -0500 Subject: [PATCH] Fix - packging workflow for docker push --- checks/packaging.go | 5 +++++ e2e/packaging_test.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+) 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()) + }) }) })