Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit c8a2f7d

Browse files
steabertTigge
authored andcommitted
fix: improve changelog script
- fixed issue when no commits between tags - added Python version check to start of script - use python3 env (maybe not the most portable?)
1 parent 4484ad0 commit c8a2f7d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ yarn-error.log*
1818
.DS_Store
1919

2020
.env
21+
22+
__pycache__/

sbin/changelog.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import argparse
44
import re
@@ -7,6 +7,15 @@
77

88
import utils
99

10+
#
11+
# Stop immediately if version too old.
12+
#
13+
_MINIMUM_PYTHON_VERSION = "3.7"
14+
if sys.version_info < tuple(map(int, _MINIMUM_PYTHON_VERSION.split("."))):
15+
raise Exception(
16+
f"You need Python >= {_MINIMUM_PYTHON_VERSION}, but you are running {sys.version}"
17+
)
18+
1019
GITHUB_COMPARE_URL = (
1120
"https://github.com/AxisCommunications/practical-react-components/compare"
1221
)
@@ -37,6 +46,9 @@ def changelog_part(commitish_to: str, commitish_from: str, version: str):
3746
["git", "log", "--no-merges", "--date-order", "--format=%H%x09%s", commit_range]
3847
)
3948

49+
if commits == "":
50+
return ""
51+
4052
messages = {}
4153

4254
for commit in commits.split("\n"):

0 commit comments

Comments
 (0)