Skip to content

Commit

Permalink
fix: Allow milestone to be empty.
Browse files Browse the repository at this point in the history
There's already a milestone check that ensures a milestone is set. Once
it is set, we check that it's correct.
  • Loading branch information
iphydf committed Nov 12, 2024
1 parent 510a411 commit 722fce9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/check_release
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ def release_milestone() -> str:
if v)[0])


def release_pr_milestone() -> str:
def release_pr_milestone() -> Optional[str]:
if "PR_MILESTONE" not in os.environ:
print(
"WARNING: Could not find the milestone in the PR_MILESTONE environment variable."
)
print("WARNING: Skipping this check.")
sys.exit(1)
version = os.environ["PR_MILESTONE"]
if not version:
return None
if not version.startswith("v"):
print(f"WARNING: Milestone {version} does not start with 'v'.")
print("WARNING: Aborting.")
Expand Down Expand Up @@ -148,17 +150,17 @@ def main(prog: str, args: List[str]) -> None:
# Default to the milestone version if we can't read the draft release
# version. This happens when we call the workflow from a pull_request
# event as opposed to a pull_request_target event.
gh_release = pr_release
gh_release = ms_release

if local_required and gh_release != local_release:
print(f"\nFAIL: GitHub draft release {gh_release} does not match "
f"{local_origin} {local_release}")
sys.exit(1)
if ms_release != pr_release:
if pr_release and ms_release != pr_release:
print(f"\nFAIL: Next GitHub Milestone release {ms_release} does not "
f"match PR milestone {pr_release}")
sys.exit(1)
if gh_release != pr_release:
if pr_release and gh_release != pr_release:
print(f"\nFAIL: GitHub draft release {gh_release} does not match "
f"PR milestone {pr_release}")
sys.exit(1)
Expand Down

0 comments on commit 722fce9

Please sign in to comment.