Skip to content

Commit 6f118a6

Browse files
committed
Make sure the exact version doesn't have a leading v
1 parent 29c4319 commit 6f118a6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/create-release-pr.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
2-
name: Manage new releases
3-
4-
run-name: Prepare for new release via pull request
5-
62
on:
73
workflow_call:
84
inputs:

bumpchanges/getversion.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"Get the next tag version."
22

33
import argparse
4+
import re
45
import os
56
import subprocess
67

@@ -18,7 +19,16 @@ def get_next_version(repo_dir: Path, bump_type: str, exact_version: str) -> str:
1819

1920
if bump_type == "exact":
2021
last_version = "<ignored>"
22+
if not exact_version:
23+
logger.error("Exact version requested, but no version supplied!")
24+
raise RuntimeError()
25+
26+
if re.match(r"^v\d", exact_version):
27+
logger.error("Input version `{exact_version}` should not have a leading `v`")
28+
raise RuntimeError()
29+
2130
next_version = exact_version
31+
2232
else:
2333
# Get the most recent ancestor tag that matches r"v\d.*"
2434
try:

0 commit comments

Comments
 (0)