From ea893ecad2b096e9f765f2940741b4b1d9f9ef25 Mon Sep 17 00:00:00 2001 From: alexesprit Date: Fri, 27 Dec 2019 17:27:39 +0300 Subject: [PATCH] Print short commit hash The length is limited to 7 symbols. --- entrypoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.py b/entrypoint.py index 0d721f1..8d8d513 100755 --- a/entrypoint.py +++ b/entrypoint.py @@ -9,6 +9,7 @@ from github3.exceptions import NotFoundError, AuthenticationFailed ENCODING = 'utf-8' +SHORT_SHA_LEN = 7 def get_input(key): @@ -93,7 +94,7 @@ def main(): print(f'Removed {file_path}') if pushed_change: - commit_sha = pushed_change['commit'].sha + commit_sha = pushed_change['commit'][:SHORT_SHA_LEN] print(f'Pushed {commit_sha} to {branch}') else: print('No changes to push')