Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Nov 14, 2023
1 parent 2bfdcfb commit 0aab571
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func ApplyOverlay(overlayPath, inPath, outPath string) error {
"overlay",
"apply",
"-o",
"overlayPath",
overlayPath,
"-s",
inPath,
}
Expand Down
4 changes: 2 additions & 2 deletions internal/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions testing/overlay-test.env
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0aab571

Please sign in to comment.