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
# 0 not exclusively due to no version bump so check output
105
-
if [ "${STATUS:-0}" -ne 0 ]; then
106
-
echo "in if status 0"
107
-
if echo "$SEMVER_OUTPUT_RAW" | grep -q "There are no relevant changes"; then
108
-
echo "in if no release published"
109
-
# No new version, but we can find the current version
110
-
echo "No new version required getting current version from git tags"
111
-
DEV_SEMVER_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0-version-not-found") # last git tag so if multiple bumps in other branches making package version there will be some discrepancy but the purpose is distinguishing them for dev purposes.
112
-
echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
113
-
exit 0 # treat as success code didnt fail there just was no version increment required
114
-
else
115
-
echo "in else no release published"
116
-
exit $STATUS # real error → fail pipeline
117
-
fi
118
-
else
119
-
# Get version include prerelease tag
120
-
# Dry run returns different text DEV_SEMVER_VERSION=$(echo "$OUTPUT" | grep -oP 'Published release \K[^\s]+')
121
-
echo "in else so status was zero for error"
122
-
DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Dry run: would publish version \K[^\s]+')
123
-
echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
113
+
114
+
# Check for no changes and set DEV_SEMVER_VERSION accordingly
115
+
if echo "$SEMVER_OUTPUT_RAW" | grep -q 'There are no relevant changes'; then
116
+
DEV_SEMVER_VERSION="$FALLBACK_VERSION"
117
+
echo "No relevant changes found - DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION"
118
+
elif echo "$SEMVER_OUTPUT_RAW" | grep -q 'Dry run: would publish version'; then
119
+
# Extract the actual version
120
+
DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Dry run: would publish version \K[^\s]+' || echo "extract-failed")
echo "Neither 'no changes' nor 'would publish' found, using fallback"
125
+
DEV_SEMVER_VERSION="$FALLBACK_VERSION"
126
+
echo "DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION"
127
127
fi
128
+
129
+
exit 0
130
+
131
+
# 0 not exclusively due to no version bump so check output
132
+
# dry release seems not to error 1 qqqq!
133
+
# if [ "${STATUS:-0}" -ne 0 ]; then
134
+
# echo "in if status 0"
135
+
# if echo "$SEMVER_OUTPUT_RAW" | grep -q "There are no relevant changes"; then
136
+
# echo "in if no release published"
137
+
# # No new version, but we can find the current version
138
+
# echo "No new version required getting current version from git tags"
139
+
# DEV_SEMVER_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0-version-not-found") # last git tag so if multiple bumps in other branches making package version there will be some discrepancy but the purpose is distinguishing them for dev purposes.
140
+
# echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
141
+
# exit 0 # treat as success code didnt fail there just was no version increment required
142
+
# else
143
+
# echo "in else no release published"
144
+
# exit $STATUS # real error → fail pipeline
145
+
# fi
146
+
# else
147
+
# # Get version include prerelease tag
148
+
# # Dry run returns different text DEV_SEMVER_VERSION=$(echo "$OUTPUT" | grep -oP 'Published release \K[^\s]+')
149
+
# echo "in else so status was zero for error"
150
+
# DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Dry run: would publish version \K[^\s]+')
151
+
# echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
152
+
# echo "version change required true"
153
+
# # Just because weve been handling errors
154
+
# exit 0
155
+
# fi
128
156
129
157
130
158
# qqqq - name: Run semantic version (None Blocking)
0 commit comments