1
0

test composite

This commit is contained in:
yamaks2306 2022-11-23 21:29:10 +03:00
parent 30a477852c
commit f80e18d04f
3 changed files with 35 additions and 18 deletions

1
.gitignore vendored

@ -1,2 +1,3 @@
__pycache__/
.testenvs
.vscode/

@ -29,8 +29,24 @@ inputs:
required: false
runs:
using: 'docker'
image: 'Dockerfile'
using: 'composite'
steps:
- shell: bash
run: python3 ${{ github.action_path }}/main.py
env:
CHAT_ID: ${{ inputs.chat_id }}
TOKEN: ${{ inputs.token }}
STATUS: ${{ inputs.status }}
COMMIT_MESSAGE: ${{ inputs.commit_message }}
DOCKER_TAGS: ${{ inputs.docker_tags }}
INCLUDE_COMMIT_INFO: ${{ inputs.include_commit_info }}
MESSAGE: ${{ inputs.message }}
WORKFLOW: ${{ github.workflow }}
REPOSITORY: ${{ github.repository }}
SHA: ${{ github.sha }}
ACTOR: ${{ github.actor }}
TAG: ${{ github.ref }}
branding:
icon: 'send'

30
main.py

@ -2,23 +2,23 @@ import os
from message import Message
from environments import Environment
chat_id = os.getenv('INPUT_CHAT_ID')
if chat_id == "":
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('INPUT_TOKEN')
if token == "":
raise SystemExit('Variable chat_id is required. Exit.')
status = os.getenv('INPUT_STATUS')
commit = os.getenv('INPUT_COMMIT_MESSAGE')
include_commit_info = os.getenv('INPUT_INCLUDE_COMMIT_INFO')
docker_tags = os.getenv('INPUT_DOCKER_TAGS')
custom_message = os.getenv('INPUT_MESSAGE')
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('GITHUB_WORKFLOW')
github_repository = os.getenv('GITHUB_REPOSITORY')
github_sha = os.getenv('GITHUB_SHA')
github_actor = os.getenv('GITHUB_ACTOR')
tag = os.getenv('GITHUB_REF')
github_workflow = os.getenv('WORKFLOW')
github_repository = os.getenv('REPOSITORY')
github_sha = os.getenv('SHA')
github_actor = os.getenv('ACTOR')
tag = os.getenv('TAG')
envs = Environment(
chat_id,