ci: skip node setup when already present
Some checks failed
Deploy Holiday Property Booking / deploy (push) Successful in 1m43s
Playwright Holiday Property Booking / playwright (push) Failing after 1m42s
Test & Build Holiday Property Booking / test-build (push) Successful in 1m20s

This commit is contained in:
2026-05-26 08:13:05 +00:00
parent b28426594c
commit e468876d59
2 changed files with 40 additions and 2 deletions

View File

@@ -41,7 +41,27 @@ jobs:
;;
esac
- name: Check existing Node.js
id: node-check
shell: bash
run: |
set -Eeuo pipefail
if command -v node >/dev/null 2>&1; then
node_version="$(node -p 'process.versions.node')"
node_major="${node_version%%.*}"
if [ "$node_major" = "20" ]; then
echo "use_existing_node=true" >> "$GITHUB_OUTPUT"
echo "Node.js $node_version already available; skipping setup-node"
exit 0
fi
fi
echo "use_existing_node=false" >> "$GITHUB_OUTPUT"
- name: Setup Node.js
if: steps.node-check.outputs.use_existing_node != 'true'
uses: actions/setup-node@v4
with:
node-version: 20
@@ -72,4 +92,3 @@ jobs:
- name: Run Playwright suite
run: npm run test:e2e