Skip to content

Commit

Permalink
(fix): no patch release on main for automation
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-gold committed Nov 12, 2024
1 parent 9f32361 commit 9bd790a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ci/scripts/towncrier_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class Args(argparse.Namespace):
dry_run: bool


class NoPatchReleaseOnMainError(Exception):
pass


def parse_args(argv: Sequence[str] | None = None) -> Args:
parser = argparse.ArgumentParser(
prog="towncrier-automation",
Expand Down Expand Up @@ -62,6 +66,10 @@ def main(argv: Sequence[str] | None = None) -> None:
text=True,
check=True,
).stdout.strip()
if Version(args.version).micro != 0 and base_branch == "main":
raise NoPatchReleaseOnMainError(
f"Version {args.version} is a patch release, but you are trying to release from main branch."
)
pr_description = (
"" if base_branch == "main" else "@meeseeksmachine backport to main"
)
Expand Down

0 comments on commit 9bd790a

Please sign in to comment.