Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion internal/model/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading