Skip to content

Commit

Permalink
fix: error when referencing invalid actions from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippHeuer committed Jan 23, 2023
1 parent 0baf6d9 commit eaaa6db
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/common/workflowrun/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func RunWorkflowStage(cfg *config.CIDConfig, stage *config.WorkflowStage, env ma
func RunWorkflowAction(cfg *config.CIDConfig, action *config.WorkflowAction, env map[string]string, projectDir string, modulesFilter []string) {
log.Debug().Str("action", action.ID).Msg("action start")
catalogAction := cfg.FindAction(action.ID)
if catalogAction == nil {
log.Fatal().Str("action_id", action.ID).Msg("workflow configuration error, referencing actions that do not exist")
}
modules := repoanalyzer.AnalyzeProject(projectDir, filesystem.GetWorkingDirectory())
ctx := api.GetActionContext(modules, projectDir, env, &catalogAction.Access)

Expand Down
11 changes: 11 additions & 0 deletions pkg/core/config/files/cid-catalog-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,17 @@ catalog:
rules:
- type: cel
expression: MODULE_BUILD_SYSTEM == "gomod"
# semgrep
- repository: central
name: semgrep-scan
type: container
container:
image: quay.io/cidverse/cid-actions-go:latest
command: central run semgrep-scan
scope: project
access:
env:
- SEMGREP_.*
# sonarqube
- repository: central
name: sonarqube-scan
Expand Down
3 changes: 3 additions & 0 deletions pkg/core/config/files/cid-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,6 @@ containerimages:
provides:
- binary: semgrep
version: 1.5.1
cache:
- id: semgrep-cache
dir: /app/.cache/semgrep-cache
4 changes: 2 additions & 2 deletions pkg/core/config/files/cid-workflow-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ workflows:
- name: scan
actions:
- id: central/gitleaks-scan
- id: central/gosec-scan
- id: central/fossa-source-scan
- id: central/semgrep-scan
#- id: central/fossa-source-scan
- id: central/sonarqube-scan
- name: report
actions:
Expand Down

0 comments on commit eaaa6db

Please sign in to comment.