From 0046b0af38dfb6e803a6a5a4c03635d9296d172e Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Mon, 25 Oct 2021 20:51:55 -0400 Subject: [PATCH] Path fixes --- src/create-envfile.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/create-envfile.py b/src/create-envfile.py index bb3a25d..34f7022 100644 --- a/src/create-envfile.py +++ b/src/create-envfile.py @@ -15,5 +15,11 @@ # .env is set by default file_name = str(os.environ.get("INPUT_FILE_NAME", ".env")) -with open(os.path.join(".", directory, file_name), "w") as text_file: +path = str(os.environ.get("GITHUB_WORKSPACE", ".")) + +# This should resolve https://github.com/SpicyPizza/create-envfile/issues/27 +if path in ["", "None"]: + path = "." + +with open(os.path.join(path, directory, file_name), "w") as text_file: text_file.write(out_file)