From 47eb32cd7ab8f159cd30ff8113bdc328a1d250e9 Mon Sep 17 00:00:00 2001 From: alberto Date: Sat, 30 May 2026 23:20:11 +0200 Subject: [PATCH] Fix: installa npm se assente, rimuove validate.yml --- .gitea/workflows/validate.yml | 34 ---------------------------------- install-opencode/action.yml | 14 +++++++++++--- 2 files changed, 11 insertions(+), 37 deletions(-) delete mode 100644 .gitea/workflows/validate.yml diff --git a/.gitea/workflows/validate.yml b/.gitea/workflows/validate.yml deleted file mode 100644 index d075318..0000000 --- a/.gitea/workflows/validate.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Validate Actions - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Valida YAML - run: | - for f in */action.yml; do - echo "Validazione: $f" - python3 -c "import yaml; yaml.safe_load(open('$f')); print('OK')" - done - - - name: Verifica struttura action - run: | - required_fields=("name" "runs") - for f in */action.yml; do - for field in "${required_fields[@]}"; do - if ! grep -q "^$field:" "$f"; then - echo "ERRORE: $f manca del campo '$field'" - exit 1 - fi - done - done - echo "Struttura azioni valida" diff --git a/install-opencode/action.yml b/install-opencode/action.yml index f81b0bd..405de56 100644 --- a/install-opencode/action.yml +++ b/install-opencode/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: composite steps: - - name: Verifica prerequisiti + - name: Verifica prerequisiti e installa npm se assente shell: bash run: | set -euo pipefail @@ -19,8 +19,16 @@ runs: exit 1 fi if ! command -v npm &> /dev/null; then - echo "ERRORE: npm non trovato." - exit 1 + echo "npm non trovato, tentativo di installazione..." + if command -v apt-get &> /dev/null; then + apt-get update -qq && apt-get install -y -qq npm 2>&1 || true + elif command -v apk &> /dev/null; then + apk add --no-cache npm 2>&1 || true + fi + if ! command -v npm &> /dev/null; then + echo "ERRORE: impossibile installare npm." + exit 1 + fi fi echo "node $(node --version), npm $(npm --version)"