Skip to content

Commit

Permalink
Print short commit hash
Browse files Browse the repository at this point in the history
The length is limited to 7 symbols.
  • Loading branch information
alexesprit committed Dec 27, 2019
1 parent 273a57d commit ea893ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from github3.exceptions import NotFoundError, AuthenticationFailed

ENCODING = 'utf-8'
SHORT_SHA_LEN = 7


def get_input(key):
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit ea893ec

Please sign in to comment.