diff options
author | 2020-08-22 03:18:25 +0200 | |
---|---|---|
committer | 2020-08-22 03:18:25 +0200 | |
commit | 503bfba6855d3019a2739bb1adce69c457a8b26e (patch) | |
tree | 25316b0e1ef7c96a0e9c6ca707c6c2294f9c12c8 /pydis_site/utils/utils.py | |
parent | Move git SHA fetcher into utils. (diff) |
Move git SHA fetcher into its own file.
Fix tests.
Diffstat (limited to 'pydis_site/utils/utils.py')
-rw-r--r-- | pydis_site/utils/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pydis_site/utils/utils.py b/pydis_site/utils/utils.py new file mode 100644 index 00000000..2033ea19 --- /dev/null +++ b/pydis_site/utils/utils.py @@ -0,0 +1,10 @@ +import git + +# Git SHA +repo = git.Repo(search_parent_directories=True) +GIT_SHA = repo.head.object.hexsha + + +def get_git_sha() -> str: + """Get the Git SHA for this repo.""" + return GIT_SHA |