Skip to content

Commit 3640c62

Browse files
authored
chore(ci): pin k0s upgrade automation to current minor (#2573)
* chore(ci): pin k0s upgrade automation to current minor * f
1 parent 3ee08cf commit 3640c62

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/dependencies.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ jobs:
2626
run: |
2727
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.
2828
export CURVERSION=$(make print-K0S_VERSION)
29-
export VERSION=$(gh release list --repo k0sproject/k0s --json name,isLatest | jq -r '.[] | select(.isLatest)|.name')
29+
export CURMAJMIN=$(echo $CURVERSION | awk -F'.' '{print $1 "." $2}')
30+
31+
# pin to the latest release for the current major.minor version
32+
export VERSION=$(gh release list --repo k0sproject/k0s --exclude-pre-releases --json name,isLatest | \
33+
jq -r "[.[] | select(.name | startswith(\"$CURMAJMIN\"))] | first | .name")
34+
3035
if [ "$CURVERSION" != "$VERSION" ]; then
3136
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
32-
sed -i "/^K0S_BINARY_SOURCE_OVERRIDE/c\K0S_BINARY_SOURCE_OVERRIDE =" Makefile
37+
sed -i "/^K0S_GO_VERSION/c\K0S_GO_VERSION = $VERSION" Makefile
38+
# replace the first occurrence of K0S_BINARY_SOURCE_OVERRIDE
39+
sed -i '0,/K0S_BINARY_SOURCE_OVERRIDE =.*/s/K0S_BINARY_SOURCE_OVERRIDE =.*/K0S_BINARY_SOURCE_OVERRIDE =/' Makefile
3340
make go.mod
3441
fi
3542
- name: Troubleshoot

0 commit comments

Comments
 (0)