-
Notifications
You must be signed in to change notification settings - Fork 94
64 lines (54 loc) · 2.01 KB
/
scheduled-weekly-new-nodejs-lts-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- 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: Find the last open LTS issue
id: last-issue
uses: micalevisk/last-issue-action@v2
with:
state: open
labels: |
auto-node-lts
- name: Create an issue if new LTS and not yet opened
if: ${{ steps.check-version.outputs.new_lts_version != '' && steps.last-issue.outputs.has-found != 'true' }}
uses: peter-evans/create-issue-from-file@v5
with:
title: "Support new Node.js LTS version: ${{ steps.check-version.outputs.new_lts_version }}"
content-filepath: .github/auto-issue-templates/new-node-lts.md
labels: |
auto-node-lts
maintenance