Skip to content

Commit c50444c

Browse files
authored
🦺 [just] v5.5 keeps release from releasing weird non-version versions (#92)
* 🦺 [just] v5.5 keeps release from releasing weird non-version versions * ignore what shellcheck does not understand * update release notes
1 parent 6dd0fa2 commit c50444c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

‎.just/RELEASE_NOTES.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ This file tracks the evolution of the Git/GitHub workflow automation module.
44

55
## January 2026 - Avila Beach is awesome
66

7+
### v5.6 - Release Version Validation (2026-01-30)
8+
9+
**Related PR:** [#92](https://github.com/fini-net/template-repo/pull/92)
10+
11+
Added version format validation to the `release` recipe to prevent accidental releases with malformed version numbers. Previously, you could run `just release anything` and it would attempt to create a GitHub release with whatever string you provided, potentially creating confusing or invalid release tags.
12+
13+
**New safety check:**
14+
15+
- **Version format validation** - The `release` recipe now validates that the version parameter starts with 'v' followed by a digit (e.g., v1.0.0, v2.3.4)
16+
- **Clear error message** - Displays red error message if format is invalid: "Error: Release version must start with 'v' followed by a digit"
17+
- **Early exit** - Fails fast with exit code 1 before attempting to create the GitHub release
18+
- **Shellcheck compatibility** - Added disable comment for SC2050 since shellcheck doesn't understand just's templating syntax (`{{rel_version}}`)
19+
20+
**Implementation details:**
21+
22+
- Uses bash regex pattern `^v[0-9]` to match the required format
23+
- Validation runs after the `standard-release` flag check but before the actual `gh release create` command
24+
- Prevents common typos like `just release 1.0.0` (missing 'v') or `just release vNext` (no digit)
25+
26+
This change makes the release workflow safer by catching version format errors upfront rather than creating malformed tags that would need manual cleanup. Complements the existing `standard-release` flag system from v5.3.
27+
728
### v5.5 - Robust Copilot Suggestion Application (2026-01-28)
829

930
Fixes issue [#76](https://github.com/fini-net/template-repo/issues/76)

‎.just/gh-process.just‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sync:
1313
git pull
1414
git status --porcelain # stp
1515

16-
# PR create v5.4
16+
# PR create v5.5
1717
[group('Process')]
1818
pr: _has_commits && pr_checks
1919
#!/usr/bin/env bash
@@ -202,6 +202,13 @@ release rel_version:
202202
exit 0
203203
fi
204204

205+
# Validate version format - must start with 'v' followed by a digit
206+
# shellcheck disable=SC2050 # rel_version is a variable
207+
if [[ ! "{{rel_version}}" =~ ^v[0-9] ]]; then
208+
echo "{{RED}}Error: Release version must start with 'v' followed by a digit (e.g., v1.0.0, v2.3.4){{NORMAL}}"
209+
exit 1
210+
fi
211+
205212
# Standard release workflow
206213
gh release create "{{rel_version}}" --generate-notes
207214
sleep 1

0 commit comments

Comments
 (0)