Skip to content

Commit

Permalink
feat: now uses actions/setup-node
Browse files Browse the repository at this point in the history
  • Loading branch information
Toolo committed Oct 16, 2024
1 parent 812f92e commit 71ad361
Show file tree
Hide file tree
Showing 10 changed files with 1,037 additions and 50,662 deletions.
36 changes: 33 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ outputs:
The version of golang that has been installed and is ready for use.
node:
description:
The verison of Node.js that has been installed and is ready for use.
The version of Node.js that has been installed and is ready for use.
java:
description:
The version of Java that has been installed and is ready for use.
Expand All @@ -20,5 +20,35 @@ outputs:
description:
The version of Terraform that has been installed and is ready for use.
runs:
using: "node20"
main: "dist/main/index.js"
using: "composite"
steps:
- name: Read node version
id: get-node-version
run: |
# Check if an .nvmrc file exists and export the node version if it does
if [ -f .nvmrc ]; then
NODE_VERSION=$(cat .nvmrc)
echo "Node version from .nvmrc: $NODE_VERSION"
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
fi
# Check if a .node-version file exists and export the node version if it does
if [ -f .node-version ]; then
NODE_VERSION=$(cat .node-version)
echo "Node version from .node-version: $NODE_VERSION"
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
fi
shell: bash
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ steps.get-node-version.outputs.node_version || '20' }}
- name: Export installed node version
run: |
echo "Installed Node version: ${{ steps.setup-node.outputs.node-version }}"
echo "node=${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_OUTPUT
shell: bash
- name: Install Tools
id: install-tools
run: "node dist/main/index.js"
shell: bash
Loading

0 comments on commit 71ad361

Please sign in to comment.