File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,17 @@ jobs:
29
29
- name : Get latest containerlab version
30
30
id : containerlab
31
31
run : |
32
- # Fetch the latest release information from containerlab repository
33
- CONTAINERLAB_LATEST=$(curl -s https://api.github.com/repos/srl-labs/containerlab/releases/latest | jq -r .tag_name)
34
- echo "CONTAINERLAB_VERSION=${CONTAINERLAB_LATEST#v}" >> $GITHUB_OUTPUT
35
- echo "Latest containerlab version: ${CONTAINERLAB_LATEST#v}"
32
+ # Get latest version by following the redirect to the latest release
33
+ LATEST_URL=$(curl -sLI -o /dev/null -w '%{url_effective}' https://github.com/srl-labs/containerlab/releases/latest)
34
+ echo "Latest release URL: $LATEST_URL"
35
+
36
+ # Extract version from URL
37
+ CONTAINERLAB_LATEST=$(echo $LATEST_URL | rev | cut -d'/' -f1 | rev)
38
+
39
+ # Remove the 'v' prefix
40
+ CONTAINERLAB_VERSION=${CONTAINERLAB_LATEST#v}
41
+ echo "CONTAINERLAB_VERSION=$CONTAINERLAB_VERSION" >> $GITHUB_OUTPUT
42
+ echo "Latest containerlab version: $CONTAINERLAB_VERSION"
36
43
37
44
- name : Get latest WSL release version
38
45
id : current_release
You can’t perform that action at this time.
0 commit comments