Skip to content

Commit ec40620

Browse files
committed
fix: check the org after legacy fallthrough
Checking whether the org is configured can fail in acceptance tests for a test that falls through to the legacy CLI, so this check is deferred until after such fallthroughs.
1 parent 9a0ade9 commit ec40620

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/commands/ostest/ostest.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ func OSWorkflow(
100100

101101
logger.Info().Msg("Getting preferred organization ID")
102102

103-
orgID := config.GetString(configuration.ORGANIZATION)
104-
if orgID == "" {
105-
logger.Error().Msg("No organization ID provided")
106-
return nil, errFactory.NewEmptyOrgError()
107-
}
108-
109103
sbom := config.GetString(flags.FlagSBOM)
110104
sourceDir := config.GetString(flags.FlagSourceDir)
111105
sbomTestReachability := config.GetBool(flags.FlagReachability) && sbom != ""
@@ -145,6 +139,11 @@ func OSWorkflow(
145139
}
146140

147141
// Unified test flow
142+
orgID := config.GetString(configuration.ORGANIZATION)
143+
if orgID == "" {
144+
logger.Error().Msg("No organization ID provided")
145+
return nil, errFactory.NewEmptyOrgError()
146+
}
148147

149148
var riskScorePtr *uint16
150149
if riskScoreThreshold >= math.MaxUint16 {

0 commit comments

Comments
 (0)