From 2abe64df5ba74e9fcb4a4fa3fc0df8ac2e40c484 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Wed, 26 Oct 2022 19:33:08 +0200 Subject: [PATCH] ci: Update node versions retrieval algorithm --- .github/workflows/unit-test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 0f339840c..4db16dc14 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -12,10 +12,13 @@ jobs: - name: Generate Node.js versions matrix id: generate-matrix run: | - current_lts=$(curl -s https://nodejs.org/en/ | grep -E -o 'Download [0-9.]+ LTS' | grep -E -o '([0-9]+)' | head -n 1) - previous_lts=$(( current_lts - 2 )) - next_lts=$(( current_lts + 2 )) - VERSIONS="[$previous_lts, $current_lts, $next_lts]" + sudo apt-get install -y lynx + lynx -dump https://endoflife.date/nodejs | grep -E -o '[0-9]+ \(LTS\)' | grep -E -o '([0-9]+)' > eol.list + cat eol.list + lts1=$(cat eol.list | head -1) + lts2=$(cat eol.list | head -2 | tail -1) + lts3=$(cat eol.list | head -3 | tail -1) + VERSIONS="[$lts1, $lts2, $lts3]" echo ::set-output name=versions::${VERSIONS} node_test: