From 754ef6d150e7d6194c3952aaddf4b7bc78773ddb Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Tue, 7 Oct 2025 16:40:55 +0100 Subject: [PATCH] fix: mismatching workspace --- registry/tagging.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/registry/tagging.go b/registry/tagging.go index a0e85af4f..8c35f95f1 100644 --- a/registry/tagging.go +++ b/registry/tagging.go @@ -2,6 +2,8 @@ package registry import ( "context" + "fmt" + "strings" "github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations" "github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared" @@ -22,5 +24,18 @@ func AddTags(ctx context.Context, namespaceName, revisionDigest string, tags []s }, }) + if isMismatchedWorkspaceError(err) { + return fmt.Errorf("The current workspace does not match the original workspace for this registry entry. Ensure you are in the correct workspace.") + } return err } + +func isMismatchedWorkspaceError(err error) bool { + message := err.Error() + + if strings.Contains(message, "resolving for reference") { + return true + } + + return false +}