github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/pkg/cataloger/githubactions/cataloger.go (about) 1 /* 2 Package githubactions provides a concrete Cataloger implementation for GitHub Actions packages (both actions and workflows). 3 */ 4 package githubactions 5 6 import ( 7 "github.com/anchore/syft/syft/pkg" 8 "github.com/anchore/syft/syft/pkg/cataloger/generic" 9 ) 10 11 // NewActionUsageCataloger returns GitHub Actions used within workflows and composite actions. 12 func NewActionUsageCataloger() pkg.Cataloger { 13 return generic.NewCataloger("github-actions-usage-cataloger"). 14 WithParserByGlobs(parseWorkflowForActionUsage, "**/.github/workflows/*.yaml", "**/.github/workflows/*.yml"). 15 WithParserByGlobs(parseCompositeActionForActionUsage, "**/.github/actions/*/action.yml", "**/.github/actions/*/action.yaml") 16 } 17 18 // NewWorkflowUsageCataloger returns shared workflows used within workflows. 19 func NewWorkflowUsageCataloger() pkg.Cataloger { 20 return generic.NewCataloger("github-action-workflow-usage-cataloger"). 21 WithParserByGlobs(parseWorkflowForWorkflowUsage, "**/.github/workflows/*.yaml", "**/.github/workflows/*.yml") 22 }