def METHOD_NAME():
    """Return the current branch of the current workspace"""
    # https://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git
    branch = subprocess.check_output(
        ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode().strip()
    if branch == 'HEAD':
        # Probably in a detached state inside gitlab CI
        # Fallback to the branch name defined in an env var
        branch = 'origin/' + os.environ['CI_COMMIT_REF_NAME']
    return branch