31 lines
852 B
YAML
31 lines
852 B
YAML
name: Checkout with Node.js
|
|
description: "Checkout code and ensure Node.js is installed"
|
|
|
|
inputs:
|
|
ref:
|
|
description: "The branch, tag or SHA to check out"
|
|
required: false
|
|
default: ""
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Check and install Node.js if missing
|
|
shell: bash
|
|
run: |
|
|
echo "=== Node.js Installation Check ==="
|
|
if command -v node &>/dev/null; then
|
|
echo "✓ Node.js already installed: $(node --version)"
|
|
else
|
|
echo "⚠ Node.js not found, installing..."
|
|
apt-get update >/dev/null 2>&1
|
|
apt-get install -y nodejs >/dev/null 2>&1
|
|
echo "✓ Node.js installed: $(node --version)"
|
|
fi
|
|
echo "✓ npm version: $(npm --version)"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.ref }}
|