Skip to content

Commit

Permalink
feat: correctly set releases dir in monorepo mode (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-timothy-albert authored May 9, 2024
1 parent c15184c commit 9b0f991
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 9b0f991

Please sign in to comment.