diff --git a/bot.py b/bot.py index 13334c64..47a55418 100644 --- a/bot.py +++ b/bot.py @@ -23,6 +23,10 @@ def get_git_commit_number() -> str: repo_url = "https://github.com/Vladless/Solo_bot" try: + current_branch = subprocess.check_output( + ["git", "rev-parse", "--abbrev-ref", "HEAD"] + ).decode().strip() + local_number = subprocess.check_output( ["git", "rev-list", "--count", "HEAD"] ).decode().strip() @@ -35,7 +39,7 @@ def get_git_commit_number() -> str: try: remote_commit = subprocess.check_output( - ["git", "ls-remote", "origin", "refs/heads/dev"] + ["git", "ls-remote", "origin", f"refs/heads/{current_branch}"] ).decode() remote_hash = remote_commit.split()[0]