From 633d032728bda89cf58929a4d4bfa6b6b9e8e8e1 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 20 Oct 2023 19:38:15 +0200 Subject: [PATCH] main.py aktualisiert --- main.py | 82 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/main.py b/main.py index f5372eb..3e8d2ac 100644 --- a/main.py +++ b/main.py @@ -1,41 +1,41 @@ -import os -from message import Message -from environments import Environment - -chat_id = os.getenv('CHAT_ID') -if chat_id == "" or chat_id is None: - raise SystemExit('Variable chat_id is required. Exit.') -token = os.getenv('TOKEN') -if token == "" or token is None: - raise SystemExit('Variable token is required. Exit.') -status = os.getenv('STATUS') -commit = os.getenv('COMMIT_MESSAGE') -include_commit_info = os.getenv('INCLUDE_COMMIT_INFO') -docker_tags = os.getenv('DOCKER_TAGS') -custom_message = os.getenv('MESSAGE') -#GitHub environment variables -github_workflow = os.getenv('WORKFLOW') -github_repository = os.getenv('REPOSITORY') -github_sha = os.getenv('SHA') -github_actor = os.getenv('ACTOR') -github_run_id = os.getenv('GITHUB_RUN_ID') -tag = os.getenv('TAG') - -envs = Environment( - chat_id, - token, - status, - commit, - include_commit_info, - docker_tags, - custom_message, - github_workflow, - github_repository, - github_sha, - github_actor, - github_run_id, - tag -) -message = Message(envs) - -message.send_message() +import os +from message import Message +from environments import Environment + +chat_id = os.getenv('CHAT_ID') +if chat_id == "" or chat_id is None: + raise SystemExit('Variable chat_id is required. Exit.') +token = os.getenv('TOKEN') +if token == "" or token is None: + raise SystemExit('Variable token is required. Exit.') +status = os.getenv('STATUS') +commit = os.getenv('COMMIT_MESSAGE') +include_commit_info = os.getenv('INCLUDE_COMMIT_INFO') +docker_tags = os.getenv('DOCKER_TAGS') +custom_message = os.getenv('MESSAGE') +#GitHub environment variables +github_workflow = os.getenv('WORKFLOW') +github_repository = os.getenv('REPOSITORY') +github_sha = os.getenv('SHA') +github_actor = os.getenv('ACTOR') +github_run_id = os.getenv('RUN_ID') +tag = os.getenv('TAG') + +envs = Environment( + chat_id, + token, + status, + commit, + include_commit_info, + docker_tags, + custom_message, + github_workflow, + github_repository, + github_sha, + github_actor, + github_run_id, + tag +) +message = Message(envs) + +message.send_message()