File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,16 @@ set -euo pipefail
55# Calculate the next version based on the latest git tag and output GitHub Actions variables
66# Usage: get-next-version.sh
77
8+ # Helper to write GitHub Actions outputs (works locally too)
9+ gh_output () {
10+ if [[ -n " ${GITHUB_OUTPUT:- } " ]]; then
11+ echo " $1 " >> " $GITHUB_OUTPUT "
12+ fi
13+ }
14+
815# Get the latest tag, or use v0.0.0 if no tags exist
916LATEST_TAG=$( git describe --tags --abbrev=0 2> /dev/null || echo " v0.0.0" )
10- echo " latest_tag=$LATEST_TAG " >> $GITHUB_OUTPUT
17+ gh_output " latest_tag=$LATEST_TAG "
1118
1219# Extract version number and increment
1320VERSION=$( echo $LATEST_TAG | sed ' s/v//' )
@@ -20,5 +27,5 @@ PATCH=${VERSION_PARTS[2]:-0}
2027PATCH=$(( PATCH + 1 ))
2128NEW_VERSION=" v$MAJOR .$MINOR .$PATCH "
2229
23- echo " new_version=$NEW_VERSION " >> $GITHUB_OUTPUT
30+ gh_output " new_version=$NEW_VERSION "
2431echo " New version will be: $NEW_VERSION "
You can’t perform that action at this time.
0 commit comments