You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a **${{ github.event.inputs.bump }}** release. The build has already passed. Your job is to determine the next version and create the release.
77
74
78
-
### Step 1 — Determine the next version
75
+
### Step 1 — Determine the latest published version
76
+
77
+
Run both commands and use whichever returns a higher version:
79
78
80
79
```bash
81
80
git fetch --tags
82
-
PREVIOUS_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*'| sort -V | tail -n 1)
83
-
if [ -z"$PREVIOUS_TAG" ];then PREVIOUS_TAG="v0.0.0";fi
84
-
echo"$PREVIOUS_TAG"
81
+
git tag -l 'v[0-9]*.[0-9]*.[0-9]*'| sort -V | tail -n 1
85
82
```
86
83
84
+
```bash
85
+
gh release list --json tagName --jq '[.[].tagName | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))] | sort | last // empty'
86
+
```
87
+
88
+
Take the greater of the two values as `PREVIOUS_TAG`. If both are empty, use `v0.0.0`.
89
+
87
90
### Step 2 — Compute the next version
88
91
89
-
Note the previous tag printed above. Then compute the next semver version by applying a **${{ github.event.inputs.bump }}** bump:
92
+
Note the previous tag determined above. Then compute the next semver version by applying a **${{ github.event.inputs.bump }}** bump:
90
93
-`patch`: increment the patch number (e.g. `v1.2.3` → `1.2.4`)
91
94
-`minor`: increment the minor number, reset patch (e.g. `v1.2.3` → `1.3.0`)
92
95
-`major`: increment the major number, reset minor and patch (e.g. `v1.2.3` → `2.0.0`)
@@ -97,4 +100,4 @@ Call the `create_release` tool with:
97
100
98
101
-`version`: the computed next version string (without the `v` prefix, e.g. `1.2.4`)
99
102
100
-
Call `noop` only if the computed tag already exists locally (`git rev-parse "v<next-version>"`) or on origin (`git ls-remote --tags origin "v<next-version>"`).
103
+
Call `noop` only if the computed release already exists: check both `git ls-remote --tags origin "v<next-version>"` and `gh release view "v<next-version>"`. If either indicates the version exists, call `noop` instead.
0 commit comments