main.py aktualisiert
This commit is contained in:
parent
72e8acdbb2
commit
633d032728
82
main.py
82
main.py
@ -1,41 +1,41 @@
|
|||||||
import os
|
import os
|
||||||
from message import Message
|
from message import Message
|
||||||
from environments import Environment
|
from environments import Environment
|
||||||
|
|
||||||
chat_id = os.getenv('CHAT_ID')
|
chat_id = os.getenv('CHAT_ID')
|
||||||
if chat_id == "" or chat_id is None:
|
if chat_id == "" or chat_id is None:
|
||||||
raise SystemExit('Variable chat_id is required. Exit.')
|
raise SystemExit('Variable chat_id is required. Exit.')
|
||||||
token = os.getenv('TOKEN')
|
token = os.getenv('TOKEN')
|
||||||
if token == "" or token is None:
|
if token == "" or token is None:
|
||||||
raise SystemExit('Variable token is required. Exit.')
|
raise SystemExit('Variable token is required. Exit.')
|
||||||
status = os.getenv('STATUS')
|
status = os.getenv('STATUS')
|
||||||
commit = os.getenv('COMMIT_MESSAGE')
|
commit = os.getenv('COMMIT_MESSAGE')
|
||||||
include_commit_info = os.getenv('INCLUDE_COMMIT_INFO')
|
include_commit_info = os.getenv('INCLUDE_COMMIT_INFO')
|
||||||
docker_tags = os.getenv('DOCKER_TAGS')
|
docker_tags = os.getenv('DOCKER_TAGS')
|
||||||
custom_message = os.getenv('MESSAGE')
|
custom_message = os.getenv('MESSAGE')
|
||||||
#GitHub environment variables
|
#GitHub environment variables
|
||||||
github_workflow = os.getenv('WORKFLOW')
|
github_workflow = os.getenv('WORKFLOW')
|
||||||
github_repository = os.getenv('REPOSITORY')
|
github_repository = os.getenv('REPOSITORY')
|
||||||
github_sha = os.getenv('SHA')
|
github_sha = os.getenv('SHA')
|
||||||
github_actor = os.getenv('ACTOR')
|
github_actor = os.getenv('ACTOR')
|
||||||
github_run_id = os.getenv('GITHUB_RUN_ID')
|
github_run_id = os.getenv('RUN_ID')
|
||||||
tag = os.getenv('TAG')
|
tag = os.getenv('TAG')
|
||||||
|
|
||||||
envs = Environment(
|
envs = Environment(
|
||||||
chat_id,
|
chat_id,
|
||||||
token,
|
token,
|
||||||
status,
|
status,
|
||||||
commit,
|
commit,
|
||||||
include_commit_info,
|
include_commit_info,
|
||||||
docker_tags,
|
docker_tags,
|
||||||
custom_message,
|
custom_message,
|
||||||
github_workflow,
|
github_workflow,
|
||||||
github_repository,
|
github_repository,
|
||||||
github_sha,
|
github_sha,
|
||||||
github_actor,
|
github_actor,
|
||||||
github_run_id,
|
github_run_id,
|
||||||
tag
|
tag
|
||||||
)
|
)
|
||||||
message = Message(envs)
|
message = Message(envs)
|
||||||
|
|
||||||
message.send_message()
|
message.send_message()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user