Skip to content

feat: correctly set releases dir in monorepo mode #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2024
Merged
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
8 changes: 8 additions & 0 deletions internal/actions/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package actions

import (
"github.com/speakeasy-api/sdk-generation-action/internal/configuration"
"github.com/speakeasy-api/sdk-generation-action/internal/environment"
)

func getReleasesDir() (string, error) {
Expand All @@ -12,6 +13,13 @@ func getReleasesDir() (string, error) {
return "", err
}

// Checking for multiple targets ensures backward compatibility with the code below
if len(wf.Targets) > 1 && environment.SpecifiedTarget() != "" {
if target, ok := wf.Targets[environment.SpecifiedTarget()]; ok && target.Output != nil {
return *target.Output, nil
}
}

for _, target := range wf.Targets {
// If we are only generating one language and its not in the root directory we assume this is a multi-sdk repo
if len(wf.Targets) == 1 && target.Output != nil && *target.Output != "." {
Expand Down
Loading