def METHOD_NAME(ctx, repo):
    # borg 1.0 sorts ascending by default so taking the tail will get the most recent backup
    archive = ctx.run(
        "borg list --short {repo} | tail -n 1".format(repo=repo),
        echo=True,
        env=environment(),
    ).stdout.strip()
    if not archive:
        raise RuntimeError("no borg archives found")
    return archive