diff --git a/cmd/root.go b/cmd/root.go index 7954b81c4..08272ab05 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -161,6 +161,13 @@ func checkForUpdate(ctx context.Context, currentVersion, artifactArch string, cm return } + wf, _, _ := utils.GetWorkflow() + + // If we are running the run command and a workflow file is present and specifies that the speakeasyVersion is "latest", don't display update notifications as it will be automatically updated when the command is run. + if cmd.Name() == "run" && wf != nil && wf.SpeakeasyVersion.String() == "latest" { + return + } + newerVersion, err := updates.GetNewerVersion(ctx, artifactArch, currentVersion) if err != nil { return // Don't display error to user diff --git a/internal/model/command.go b/internal/model/command.go index fc41cb2a8..a932f00d9 100644 --- a/internal/model/command.go +++ b/internal/model/command.go @@ -312,7 +312,11 @@ func runWithVersionFromWorkflowFile(cmd *cobra.Command) error { } desiredVersion = latest.String() - logger.PrintfStyled(styles.DimmedItalic, "Running with latest Speakeasy version\n") + // Check if we're actually running the latest version + currentVersion := events.GetSpeakeasyVersionFromContext(ctx) + if newerVersion, err := updates.GetNewerVersion(ctx, artifactArch, currentVersion); err == nil && newerVersion == nil { + logger.PrintfStyled(styles.DimmedItalic, "Running with latest Speakeasy version\n") + } } else if desiredVersion == "pinned" { return ErrPinned } else {