Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default directory envkey option #22

Merged
merged 1 commit into from
May 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/create-envfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
out_file += key.split("INPUT_ENVKEY_")[1] + "=" + os.environ.get(key) + "\n"

# get directory name in which we want to create .env file
directory = str(os.environ.get("INPUT_DIRECTORY"))
directory = str(os.environ.get("INPUT_DIRECTORY", ""))

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

path = str(os.environ.get("INPUT_GITHUB_WORKSPACE"))
path = str(os.environ.get("GITHUB_WORKSPACE", ""))
if path == "":
raise Exception("Could not get the GITHUB_WORKSPACE environment variable.")
raise Exception("Could not get the GITHUB_WORKSPACE environment variable.")

with open(os.path.join(path, directory, file_name), "w") as text_file:
text_file.write(out_file)