diff --git a/pkg/cli/update_command_test.go b/pkg/cli/update_command_test.go index c58c8e91c51..b1486a3ace3 100644 --- a/pkg/cli/update_command_test.go +++ b/pkg/cli/update_command_test.go @@ -968,7 +968,7 @@ func TestIsBranchRef(t *testing.T) { } } -// TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows errors when no source workflows exist +// TestRunUpdateWorkflows_NoSourceWorkflows tests that RunUpdateWorkflows reports a message (not an error) when no source workflows exist func TestRunUpdateWorkflows_NoSourceWorkflows(t *testing.T) { tmpDir := testutil.TempDir(t, "test-*") originalDir, _ := os.Getwd() @@ -979,10 +979,9 @@ func TestRunUpdateWorkflows_NoSourceWorkflows(t *testing.T) { require.NoError(t, os.MkdirAll(workflowsDir, 0755)) os.Chdir(tmpDir) - // Running update with no source workflows should fail + // Running update with no source workflows should succeed with an info message, not an error err := RunUpdateWorkflows(nil, false, false, false, "", "", false, "", false) - require.Error(t, err, "Should error when no workflows with source field exist") - assert.Contains(t, err.Error(), "no workflows found with source field") + assert.NoError(t, err, "Should not error when no workflows with source field exist") } // TestRunUpdateWorkflows_SpecificWorkflowNotFound tests that RunUpdateWorkflows errors for unknown workflow name diff --git a/pkg/cli/update_workflows.go b/pkg/cli/update_workflows.go index 8f866186e3c..c51dab7a3f8 100644 --- a/pkg/cli/update_workflows.go +++ b/pkg/cli/update_workflows.go @@ -34,7 +34,8 @@ func UpdateWorkflows(workflowNames []string, allowMajor, force, verbose bool, en if len(workflowNames) > 0 { return errors.New("no workflows found matching the specified names with source field") } - return errors.New("no workflows found with source field") + fmt.Fprintln(os.Stderr, console.FormatInfoMessage("no workflows found with source field")) + return nil } fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Found %d workflow(s) to update", len(workflows)))) diff --git a/pkg/workflow/data/action_pins.json b/pkg/workflow/data/action_pins.json index 8366ec146ee..6cc217598c4 100644 --- a/pkg/workflow/data/action_pins.json +++ b/pkg/workflow/data/action_pins.json @@ -110,6 +110,11 @@ "version": "v6", "sha": "b7c566a772e6b6bfb58ed0dc250532a479d7789f" }, + "anchore/sbom-action@v0": { + "repo": "anchore/sbom-action", + "version": "v0", + "sha": "17ae1740179002c89186b61233e0f892c3118b11" + }, "anchore/sbom-action@v0.22.2": { "repo": "anchore/sbom-action", "version": "v0.22.2",