latex-packages/.ci/deploy/deploy_message.py

20 lines
548 B
Python
Raw Permalink Normal View History

2021-10-18 15:55:52 +02:00
import os
2021-10-24 10:35:53 +02:00
def get_latest_commit(repo):
if repo.head.is_detached:
return repo.head.commit
else:
return repo.head.ref.commit
2021-10-18 15:55:52 +02:00
def get_deploy_message(repo):
old_msg = get_latest_commit(repo).message
return "{old_msg}\n" \
"\n" \
"Build branch {branch} ({hexsha}) from {repo_name}" \
.format(old_msg=old_msg,
2021-10-24 10:35:53 +02:00
branch=os.environ['CI_COMMIT_REF_NAME'],
2021-10-18 15:55:52 +02:00
hexsha=get_latest_commit(repo).hexsha[0:7],
repo_name='kesslermaximilian/LatexPackages')