Files
ci/setup-node/action.yml
T
ozan d61246e7e4 docs: add provenance comments — what was replaced, why, what was removed
Each action.yml now documents:
- Original upstream repo (GitHub Actions)
- Why it was rewritten for self-hosted Gitea
- What was removed from the original
- Author and date
2026-05-22 17:55:30 +01:00

50 lines
1.8 KiB
YAML

# Tinqs Setup Node — replaces actions/setup-node@v4
# Original: https://github.com/actions/setup-node (GitHub-hosted, Node.js action)
# Why rewritten: Original depends on GitHub tool cache and @actions/core Node.js package.
# Self-hosted Gitea runners don't have the tool cache infrastructure.
# This composite action installs Node via NodeSource APT repo and pnpm via npm.
# Skips install if correct major version already present (pre-baked runner image).
# Removed from original: tool cache, .nvmrc/.node-version file, registry-url, cache (yarn/pnpm).
# Author: Ozan / Claude Code — 2026-05-22
# Part of: tinqs/ci (Tinqs CI toolchain)
name: 'Tinqs Setup Node'
description: 'Install Node.js and pnpm (replaces actions/setup-node)'
inputs:
node-version:
description: 'Node.js major version'
default: '22'
pnpm:
description: 'Install pnpm (true/false)'
default: 'true'
runs:
using: 'composite'
steps:
- run: |
NODE_VERSION="${{ inputs.node-version }}"
INSTALL_PNPM="${{ inputs.pnpm }}"
# Skip if already installed at correct major version
if command -v node &>/dev/null; then
CURRENT=$(node --version | grep -oP '\d+' | head -1)
if [ "$CURRENT" = "$NODE_VERSION" ]; then
echo "Node $NODE_VERSION already installed"
node --version
[ "$INSTALL_PNPM" = "true" ] && command -v pnpm &>/dev/null && pnpm --version && exit 0
fi
fi
echo "Installing Node.js $NODE_VERSION..."
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash -
apt-get install -y nodejs
if [ "$INSTALL_PNPM" = "true" ]; then
npm install -g pnpm
pnpm --version
fi
node --version
shell: bash