feat(release): allow release branches via RELEASE_BRANCHES env (default main)
This commit is contained in:
+8
-3
@@ -170,6 +170,11 @@ def main(argv=None, *, run=subprocess.run, repo_root: Path | None = None) -> int
|
||||
return result
|
||||
|
||||
def precheck():
|
||||
allowed = {
|
||||
b.strip()
|
||||
for b in os.environ.get("RELEASE_BRANCHES", "main").split(",")
|
||||
if b.strip()
|
||||
}
|
||||
for r in (backend, webui):
|
||||
out = run(["git", "-C", str(r), "status", "--porcelain"], capture_output=True, text=True)
|
||||
if out.stdout.strip():
|
||||
@@ -178,9 +183,9 @@ def main(argv=None, *, run=subprocess.run, repo_root: Path | None = None) -> int
|
||||
["git", "-C", str(r), "branch", "--show-current"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
if branch.stdout.strip() != "main":
|
||||
raise RuntimeError(f"{r} is not on main")
|
||||
).stdout.strip()
|
||||
if branch not in allowed:
|
||||
raise RuntimeError(f"{r} is on {branch}, not in RELEASE_BRANCHES {sorted(allowed)}")
|
||||
|
||||
def tests():
|
||||
if args.skip_tests:
|
||||
|
||||
Reference in New Issue
Block a user