diff --git a/scripts/release.py b/scripts/release.py index f04734d..af28975 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -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: