Skip to content

Commit

Permalink
fix: retrieval of active node versions in ci
Browse files Browse the repository at this point in the history
Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
  • Loading branch information
rostislav-simonik and mightyiam committed Jul 14, 2023
1 parent 347a218 commit 5ccd9a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ jobs:
get-supported-node-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: get
uses: msimerson/node-lts-versions@v1.4.3
run: |
set -euxo pipefail
active_versions=$(bash get-node-supported-versions.sh)
echo "active=$active_versions" >> "$GITHUB_OUTPUT"
outputs:
versions: ${{ steps.get.outputs.active }}
7 changes: 7 additions & 0 deletions get-node-supported-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail
url=https://raw.githubusercontent.com/nodejs/Release/master/schedule.json
release_schedule=$(curl -s $url)
today=$(date "+%Y-%m-%d")
active_versions=$(echo $release_schedule | jq -s "[ .[] | to_entries[] | select(.value.start <= \"$today\" and .value.end >= \"$today\") | .key[1:] ]")
echo $active_versions

0 comments on commit 5ccd9a6

Please sign in to comment.