Fix: installa npm se assente, rimuove validate.yml
This commit is contained in:
@@ -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"
|
|
||||||
@@ -10,7 +10,7 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Verifica prerequisiti
|
- name: Verifica prerequisiti e installa npm se assente
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -19,9 +19,17 @@ runs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! command -v npm &> /dev/null; then
|
if ! command -v npm &> /dev/null; then
|
||||||
echo "ERRORE: npm non trovato."
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
echo "node $(node --version), npm $(npm --version)"
|
echo "node $(node --version), npm $(npm --version)"
|
||||||
|
|
||||||
- name: Installa opencode
|
- name: Installa opencode
|
||||||
|
|||||||
Reference in New Issue
Block a user