Skip to content

Commit d480544

Browse files
authored
[main] Skip Kubernetes tags >= v1.33.0 in workflow script (#170)
* skip version greater than v1.33.0 * update upstream tag checkout logic * remove unnecessary checks
1 parent 1769f2e commit d480544

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/create-release-branch.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
set -e
4-
4+
MAX_VERSION="v1.33.0"
55
NEW_RELEASE_BRANCHES=()
66

77
# Define temporary files
@@ -27,12 +27,24 @@ if ! git remote get-url upstream &>/dev/null; then
2727
fi
2828

2929
# Fetch upstream tags
30-
git fetch --tags --quiet upstream || true
30+
git fetch --tags --quiet --force upstream || true
3131

3232
# Process each tag
3333
for tag in $NEW_TAGS; do
3434
echo "========================================================================================"
3535
echo "[INFO] Processing version: ${tag}"
36+
37+
# Skip if tag > MAX_VERSION
38+
if [[ "$(printf '%s\n' "$tag" "$MAX_VERSION" | sort -V | tail -1)" == "$tag" ]]; then
39+
echo "[INFO] Skipping version $tag as it is >= $MAX_VERSION"
40+
continue
41+
fi
42+
43+
# Skip if the tag does not exist locally
44+
if ! git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
45+
echo "[WARN] Tag $tag does not exist locally. Skipping."
46+
continue
47+
fi
3648

3749
# Check if the branch already exist
3850
if git show-ref --verify --quiet refs/remotes/origin/release-${tag}; then

0 commit comments

Comments
 (0)