Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
srosam committed Feb 3, 2023
1 parent 7e2a276 commit c4c13f3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import os
import requests # noqa We are just importing this to prove the dependency installed correctly

messages = []

def send_log():
env_file = os.getenv('GITHUB_ENV')

env_file = "./foo.txt"
message = "\n".join(messages)

with open(env_file, "a") as myfile:
myfile.write(f"MY_VAR={message}")
myfile.write(f"{message}")

def log_message(message):
messages.append(message)


def main():
try:
log_message("foo")
log_message("bar")
log_message("baz")
log_message("\nMY_VAR=foo")
log_message("\nMY_VAR=bar")
log_message("\nMY_VAR=baz")
except Exception as e:
log_message("Error")
log_message("\nMY_VAR=Error")
finally:
send_log()

Expand Down

0 comments on commit c4c13f3

Please sign in to comment.