Skip to content

Commit

Permalink
Merge pull request #31 from KonstantinKlepikov/master
Browse files Browse the repository at this point in the history
fix problem with folder creation
  • Loading branch information
AngelOnFira committed Oct 26, 2021
2 parents 7ca2737 + 0046b0a commit 95b8234
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/create-envfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

# get file name in which we want to add variables
# .env is set by default
file_name = str(os.environ.get("INPUT_FILE_NAME"))
file_name = str(os.environ.get("INPUT_FILE_NAME", ".env"))

path = str(os.environ.get("GITHUB_WORKSPACE", ""))
if path == "":
raise Exception("Could not get the GITHUB_WORKSPACE environment variable.")
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)

0 comments on commit 95b8234

Please sign in to comment.