Fix CI: Install Node.js in containers for checkout action
Some checks failed
CI / lint-and-test (push) Failing after 4m6s
CI / secret-scanning (push) Successful in 1m32s
CI / security-scan (push) Successful in 3m46s
CI / dependency-scan (push) Successful in 2m47s
CI / sast-scan (push) Successful in 5m47s
CI / container-scan (push) Successful in 4m54s
CI / docker-build-test (push) Failing after 1m12s
CI / workflow-summary (push) Successful in 1m4s

ISSUE:
======
Gitea Actions containers need Node.js to run actions/checkout@v4
Error: 'exec: "node": executable file not found in $PATH'

FIX:
====
Added Node.js installation step before checkout in all jobs:

For Debian/Ubuntu containers (python:3.11-bullseye, ubuntu:22.04):
  apt-get update && apt-get install -y curl git
  curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
  apt-get install -y nodejs

For Alpine containers (gitleaks, trivy):
  apk add --no-cache nodejs npm curl git

JOBS FIXED:
===========
 lint-and-test
 secret-scanning
 security-scan
 dependency-scan
 sast-scan
 container-scan
 docker-build-test (no container, already works)

This is a common requirement for Gitea Actions when using
custom containers.
This commit is contained in:
ilia 2025-12-24 22:53:33 -05:00
parent bb0bce40c9
commit f94ca17b39

View File

@ -27,6 +27,12 @@ jobs:
--health-retries 5 --health-retries 5
steps: steps:
- name: Install Node.js for checkout action
run: |
apt-get update && apt-get install -y curl git
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Check out code - name: Check out code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -94,6 +100,12 @@ jobs:
container: container:
image: python:3.11-bullseye image: python:3.11-bullseye
steps: steps:
- name: Install Node.js for checkout action
run: |
apt-get update && apt-get install -y curl git
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Check out code - name: Check out code
uses: actions/checkout@v4 uses: actions/checkout@v4