1 2 3 4 5
import git # Git SHA repo = git.Repo(search_parent_directories=True) GIT_SHA = repo.head.object.hexsha