Run a preflight before each fresh worker and put its facts in the worker's prompt
This commit is contained in:
@@ -47,6 +47,13 @@ def origin_head() -> str | Failure:
|
||||
return Failure("origin names no default branch; set it with `git remote set-head origin --auto`")
|
||||
|
||||
|
||||
def newest_release_tag(branch: str) -> str | None | Failure:
|
||||
"""The newest `v*` tag merged into branch, None when it has none."""
|
||||
# Sorts v1.0.0-rc.1 below v1.0.0.
|
||||
tags = git("-c", "versionsort.suffix=-", "tag", "--list", "v*", "--merged", branch, "--sort=-v:refname")
|
||||
return tags if isinstance(tags, Failure) else next(iter(tags.split()), None)
|
||||
|
||||
|
||||
def commit_exists(commit: str) -> bool:
|
||||
return not isinstance(git("rev-parse", "--quiet", "--verify", f"{commit}^{{commit}}"), Failure)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user