Skip to content

Weekly new Node.js LTS check #2

Weekly new Node.js LTS check

Weekly new Node.js LTS check #2

name: Weekly new Node.js LTS check
on:
workflow_dispatch:
# Run on every Sunday to check if a new Node.js LTS that we don't support is released, and create an Issue if this is the case
schedule:
- cron: "0 4 * * 0"
defaults:
run:
shell: bash
jobs:
load-nodejs-supported-versions:
uses: ./.github/workflows/reusable-load-nodejs-supported-versions.yml
lts-check:
needs: load-nodejs-supported-versions
runs-on: ubuntu-latest
steps:
- name: Compare supported versions with current active Node.js LTS
id: check-version
run: |
active_lts="$(curl -s https://nodejs.org/dist/index.json \
| jq -r '[.[] | select(.lts != false)] | .[0].version' \
| sed 's/v//' \
| cut -d. -f1)"
echo "Current active Node.js LTS is ${active_lts}"
while read -r version
do
if [[ "$(echo "${version}" | cut -d. -f1)" == "${active_lts}" ]]
then
echo "> is already supported"
exit 0
fi
done < <(echo '${{ needs.load-nodejs-supported-versions.outputs.node_versions }}' | jq -r -c '.[]')
echo "> is NOT yet supported!"
echo "new_lts_version=${active_lts}" >> "${GITHUB_OUTPUT}"
- name: Create an issue if new LTS
if: steps.check-version.outputs.new_lts_version
uses: peter-evans/create-issue-from-file@v5
with:
title: "New Node.js LTS version: ${{ steps.check-version.outputs.new_lts_version }}"
content-filepath: .github/auto-issue-templates/new-node-lts.md
labels: |
auto
maintenance