diff --git a/Makefile b/Makefile index 8c6af055..da16f9bc 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,6 @@ test-release-mode-multi-sdk: test-validate-action: ./testing/test.sh ./testing/validate-action.env + +test-overlay: + ./testing/test.sh ./testing/overlay-test.env \ No newline at end of file diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 46cb1a0d..869ce813 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -293,7 +293,7 @@ func ApplyOverlay(overlayPath, inPath, outPath string) error { "overlay", "apply", "-o", - "overlayPath", + overlayPath, "-s", inPath, } diff --git a/internal/document/document.go b/internal/document/document.go index 50c9cf2f..82ee4890 100644 --- a/internal/document/document.go +++ b/internal/document/document.go @@ -109,7 +109,7 @@ func GetOpenAPIFileInfo() (string, string, string, error) { } func mergeFiles(files []string) (string, error) { - outPath := filepath.Join(environment.GetWorkspace(), "repo", "openapi", "openapi_merged") + outPath := filepath.Join(environment.GetWorkspace(), "repo", ".openapi", "openapi_merged") if err := os.MkdirAll(filepath.Dir(outPath), os.ModePerm); err != nil { return "", fmt.Errorf("failed to create openapi directory: %w", err) @@ -123,7 +123,7 @@ func mergeFiles(files []string) (string, error) { } func applyOverlay(filePath string, overlayFiles []string) (string, error) { - outPath := filepath.Join(environment.GetWorkspace(), "repo", "openapi", "openapi_overlay") + outPath := filepath.Join(environment.GetWorkspace(), "repo", ".openapi", "openapi_overlay") if err := os.MkdirAll(filepath.Dir(outPath), os.ModePerm); err != nil { return "", fmt.Errorf("failed to create openapi directory: %w", err) diff --git a/testing/overlay-test.env b/testing/overlay-test.env new file mode 100644 index 00000000..b6f5709d --- /dev/null +++ b/testing/overlay-test.env @@ -0,0 +1,8 @@ +INPUT_MODE="pr" +INPUT_ACTION="generate" +INPUT_LANGUAGES="- go" +INPUT_OPENAPI_DOCS="[\"base_oas.yaml\"]" +INPUT_OVERLAY_DOCS="[\"terraform_overlay.yaml\"]" +GITHUB_REPOSITORY="speakeasy-api/sdk-generation-action-overlay-test" +INPUT_FORCE=true +RUN_FINALIZE=true