From f4484cc7c5d9dceddd1e9fc37dc7011723515e66 Mon Sep 17 00:00:00 2001 From: Arvind Shelke Date: Thu, 14 Aug 2025 14:58:43 +0530 Subject: [PATCH 1/2] Update main.py --- main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index ae28621..e8a0e76 100644 --- a/main.py +++ b/main.py @@ -12,12 +12,23 @@ def main(): return try: + dangerous_data = os.getenv("UNSAFE_INPUT", "{}") + parsed_dangerous_data = eval(dangerous_data) + print(f"Parsed unsafe input: {parsed_dangerous_data}") + with open(github_event_path, "r") as file: event_data = json.load(file) + print("Event JSON Payload:") print(json.dumps(event_data, indent=2)) + + output_path = "/tmp/event_dump.json" + with open(output_path, "w") as outfile: + outfile.write(json.dumps(event_data)) + print(f"Event data written to: {output_path}") + except Exception as e: print(f"Error reading event data: {e}") if __name__ == "__main__": - main() \ No newline at end of file + main() From 3939b34bc26b935c1e5c7970c67d1bc13422f67e Mon Sep 17 00:00:00 2001 From: Arvind Shelke Date: Thu, 14 Aug 2025 15:02:59 +0530 Subject: [PATCH 2/2] Update main.py Co-authored-by: refacto-test[bot] <217047508+refacto-test[bot]@users.noreply.github.com> --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e8a0e76..74b77de 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ def main(): try: dangerous_data = os.getenv("UNSAFE_INPUT", "{}") - parsed_dangerous_data = eval(dangerous_data) + parsed_dangerous_data = json.loads(dangerous_data) print(f"Parsed unsafe input: {parsed_dangerous_data}") with open(github_event_path, "r") as file: