-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (70 loc) · 2.32 KB
/
Copy pathci-validation.yml
File metadata and controls
88 lines (70 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# .github/workflows/ci-validation.yml
# Versión corregida: añade permissions mínimas en cada job.
# Reemplaza tu ci-validation.yml actual con este.
name: CI Validation
on:
push:
branches: [deploy, master]
pull_request:
branches: [deploy]
# Permisos globales: solo lectura (mínimo privilegio)
permissions:
contents: read
jobs:
# ── Frontend ──────────────────────────────────────────────────
frontend-checks:
name: Frontend (Angular)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
# Permisos mínimos para este job
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint --if-present
- name: Build (producción)
run: npm run build -- --configuration production
# ── Backend ───────────────────────────────────────────────────
backend-checks:
name: Backend (Spring Boot)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Java 25
uses: actions/setup-java@v5
with:
java-version: "25"
distribution: "temurin"
cache: "maven"
- name: Build con Maven
run: mvn -B clean package -DskipTests
# ── Security summary ──────────────────────────────────────────
security-summary:
name: Resumen de seguridad
runs-on: ubuntu-latest
needs: [frontend-checks, backend-checks]
# Necesita write para publicar el resumen en el PR
permissions:
contents: read
security-events: read
steps:
- name: CI completado correctamente
run: echo "Frontend y backend OK"