Skip to content

Commit bc0600d

Browse files
avalleteclaude
andauthored
chore(ci): strip leading v from VERSION before comparing (#5326)
The smoke test workflow compares the output of `supabase --version` against the `VERSION` environment variable. However, `supabase --version` outputs the version without a leading `v`, while release tags and setup-cli inputs include it. This causes version mismatches during testing. **Changes:** - Strip the leading `v` from `VERSION` before comparison in both smoke test jobs - Add clarifying comments explaining why the stripping is necessary The fix uses bash parameter expansion (`${VERSION#v}`) to remove the leading `v` if present, ensuring the comparison is between two consistently formatted version strings. https://claude.ai/code/session_01S5jBFMNp5mHAWhS9inCagB Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8fc9b68 commit bc0600d

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/setup-cli-smoke-test.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ jobs:
6060
shell: bash
6161
run: |
6262
set -euo pipefail
63+
# `supabase --version` prints the version without the leading `v`,
64+
# while release tags / setup-cli inputs include it, so strip it
65+
# before comparing.
66+
expected="${VERSION#v}"
6367
actual="$(supabase --version | tr -d '\r' | head -n1)"
6468
echo "supabase --version: ${actual}"
65-
if [ "${actual}" != "${VERSION}" ]; then
66-
echo "Version mismatch: expected ${VERSION}, got ${actual}" >&2
69+
if [ "${actual}" != "${expected}" ]; then
70+
echo "Version mismatch: expected ${expected}, got ${actual}" >&2
6771
exit 1
6872
fi
6973
@@ -108,9 +112,13 @@ jobs:
108112
shell: bash
109113
run: |
110114
set -euo pipefail
115+
# `supabase --version` prints the version without the leading `v`,
116+
# while release tags / setup-cli inputs include it, so strip it
117+
# before comparing.
118+
expected="${VERSION#v}"
111119
actual="$(supabase --version | tr -d '\r' | head -n1)"
112120
echo "supabase --version: ${actual}"
113-
if [ "${actual}" != "${VERSION}" ]; then
114-
echo "Version mismatch: expected ${VERSION}, got ${actual}" >&2
121+
if [ "${actual}" != "${expected}" ]; then
122+
echo "Version mismatch: expected ${expected}, got ${actual}" >&2
115123
exit 1
116124
fi

0 commit comments

Comments
 (0)