File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,22 @@ jobs:
28
28
uses : actions/checkout@v4
29
29
with :
30
30
ref : ' main'
31
+ fetch-depth : 0
32
+
33
+ - name : Setup Node
34
+ uses : actions/setup-node@v4
35
+ with :
36
+ node-version : lts/*
31
37
32
38
- name : Install Dependencies
33
39
run : |
34
40
sudo apt-get install jq
35
41
36
- - name : Get Serverless Version
42
+ - name : Get Latest Serverless Version
37
43
id : sls
38
44
run : |
39
45
required_version="${{ github.event.inputs.version }}"
40
- version="$(git ls-remote --tags --refs --sort="v:refname" https://github.com/ serverless/serverless.git | awk '{print $2}' | sed 's/refs\/tags\/v//' | tail -n1 )"
46
+ version="$(npm view serverless version )"
41
47
if [[ -n "$required_version" ]]; then
42
48
echo "Required version: $required_version"
43
49
echo "version=$required_version" >> "$GITHUB_OUTPUT"
@@ -46,13 +52,13 @@ jobs:
46
52
echo "version=$version" >> "$GITHUB_OUTPUT"
47
53
fi
48
54
49
- - name : Get Last Published Version
55
+ - name : Get Latest Published Docker Version
50
56
id : docker
51
57
run : |
52
58
image_repository="$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]' | sed 's/docker-//')"
53
59
echo "$image_repository"
54
60
echo "image_repository=$image_repository" >> "$GITHUB_OUTPUT"
55
- latest_published_tag="$(curl -L -s "https://hub.docker.com/v2/repositories/$image_repository/tags/?page_size=1024 &page=1&ordering=last_updated" | jq '.results | .[1] | .name' | sed 's/"//g')"
61
+ latest_published_tag="$(curl -L -s "https://hub.docker.com/v2/repositories/$image_repository/tags/?page_size=2 &page=1&ordering=last_updated" | jq '.results | .[1] | .name' | sed 's/"//g')"
56
62
echo "$latest_published_tag"
57
63
echo "latest_published_tag=$latest_published_tag" >> "$GITHUB_OUTPUT"
58
64
You can’t perform that action at this time.
0 commit comments