Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/scripts/classify-commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def classify(subject: str) -> str:

def bump_version(last: str, kinds: set) -> str:
m = re.match(r"v?(\d+)\.(\d+)\.(\d+)", last)
if m is None:
# Guard: a non-semver tag (e.g. the moving major tag "v1") reached this
# far once and produced an opaque traceback; fail loudly instead.
sys.exit(f"error: CUT_LAST_TAG is not a semver tag: {last!r}")
major, minor, patch = (int(m.group(i)) for i in (1, 2, 3))
if "breaking" in kinds or "minor" in kinds:
minor, patch = minor + 1, 0
Expand Down
5 changes: 4 additions & 1 deletion .github/scripts/cut-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ if ! git rev-parse -q --verify "${sha}^{commit}" >/dev/null; then
exit 1
fi

last_tag=$(git describe --tags --abbrev=0 "${sha}" 2>/dev/null || true)
# Last *semver* tag reachable from the target. Do NOT use "git describe
# --tags --abbrev=0": the moving major tag (v1) is also a plain tag and
# describe may return it (it did: "v1" is not a version we can bump from).
last_tag=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --merged "$sha" --sort=-v:refname | head -1)
if [ -z "$last_tag" ]; then
if [ -z "$version" ]; then
echo "::error::no previous tag to derive from; set RELEASE_VERSION explicitly" >&2
Expand Down
Loading