Skip to content

Commit

Permalink
Make sure the exact version doesn't have a leading v
Browse files Browse the repository at this point in the history
  • Loading branch information
nwiltsie committed Jul 30, 2024
1 parent 29c4319 commit 6f118a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/create-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
name: Manage new releases

run-name: Prepare for new release via pull request

on:
workflow_call:
inputs:
Expand Down
10 changes: 10 additions & 0 deletions bumpchanges/getversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"Get the next tag version."

import argparse
import re
import os
import subprocess

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

if bump_type == "exact":
last_version = "<ignored>"
if not exact_version:
logger.error("Exact version requested, but no version supplied!")
raise RuntimeError()

if re.match(r"^v\d", exact_version):
logger.error("Input version `{exact_version}` should not have a leading `v`")
raise RuntimeError()

next_version = exact_version

else:
# Get the most recent ancestor tag that matches r"v\d.*"
try:
Expand Down

0 comments on commit 6f118a6

Please sign in to comment.