File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1- name : Schedule Node.js Script
1+ name : Schedule Node.js LTS download
22
33on :
44 schedule :
@@ -18,20 +18,21 @@ jobs:
1818
1919 - name : Install dependencies
2020 run : npm install
21+
2122 - name : Check Node.js LTS Version
2223 run : |
2324 latest_lts_version=$(node src/getLatestNodeVersion.js)
2425 echo "Latest LTS version: $latest_lts_version"
25- response=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/releases/tags/$latest_lts_version)
26- existing_release=$(echo $response | jq -r '.message // "not found"')
27- if [ "$existing_release" = "Not Found" ]; then
26+ existing_release=$(gh release view --json tagName --jq '.tagName' | sort -V | tail -n 1)
27+ if [ "$(printf "$latest_lts_version\n$existing_release" | sort -V | tail -n 1)" = "$latest_lts_version" ] && [ "$latest_lts_version" != "$existing_release" ]; then
2828 echo "New Node.js LTS version detected: $latest_lts_version"
2929 echo "new_version=$latest_lts_version" >> $GITHUB_ENV
3030 else
31- echo "No new Node.js LTS version found."
31+ echo "No new Node.js LTS version found or existing version is the same ."
3232 echo "new_version=" >> $GITHUB_ENV
3333 fi
34- - name : Run script
34+
35+ - name : Download Node
3536 if : env.new_version != ''
3637 run : node src/download.js
3738
4647 name : Node.js ${{ env.new_version }} LTS Release
4748 draft : true
4849 prerelease : false
50+
4951 - name : Find Asset Files
5052 if : env.new_version != ''
5153 id : find_assets
You can’t perform that action at this time.
0 commit comments