1
0
Fork 0
mirror of https://github.com/ArtemSBulgakov/buildozer-action.git synced 2024-08-16 10:09:52 +02:00

Set author info in move_binary.py

This commit is contained in:
Artem Bulgakov 2020-12-24 20:55:11 +03:00
parent 9f94e8ca9a
commit 3d4fa5965b

View file

@ -51,10 +51,20 @@ else:
filename = "-".join([*filename_split[:2], commit_hash, *filename_split[2:]])
new_commit_message = f'Add binary for {commit_hash}: "{commit_subject}"'
# Set author info to the latest commit author
author_name = subprocess.check_output(
["git", "log", "-1", "--pretty=format:%an"]
).decode("utf-8")
author_email = subprocess.check_output(
["git", "log", "-1", "--pretty=format:%ae"]
).decode("utf-8")
subprocess.check_call(["git", "config", "user.name", author_name])
subprocess.check_call(["git", "config", "user.email", author_email])
# Prepare for pushing
os.chdir(data_repository_directory)
os.makedirs(directory, exist_ok=True)
# Ensure that there is no changes
# Ensure that there are no changes
subprocess.check_call(["git", "pull", "origin", data_repository, "--ff-only"])
# Try to push several times