-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
41 lines (34 loc) · 1.25 KB
/
action.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
name: check-node-version
description: GitHub Actions to check if node-version has been released and is available via brew node-build.
author: matzkoh
branding:
icon: check-circle
color: green
inputs:
node-version:
description: The version to check
node-version-path:
description: The path to the .node-version file
default: .node-version
runs:
using: composite
steps:
- id: check
shell: bash
run: |
if [ -n "${{ inputs.node-version }}" ]; then
node_version=${{ inputs.node-version }}
else
node_version=$(< ${{ inputs.node-version-path }})
fi
node_build_version=$(curl -s 'https://formulae.brew.sh/api/formula/node-build.json' | jq -r '.versions.stable')
echo "node-version=${node_version}" >> $GITHUB_OUTPUT
echo "node-build-version=${node_build_version}" >> $GITHUB_OUTPUT
curl -fsIo /dev/null "https://raw.githubusercontent.com/nodenv/node-build/v${node_build_version}/share/node-build/${node_version}"
outputs:
node-version:
description: The version in .node-version
value: ${{ steps.check.outputs.node-version }}
node-build-version:
description: The latest node-build version
value: ${{ steps.check.outputs.node-build-version }}