Repository navigation
145 lines (129 loc) · 5.39 KB
/
Copy pathintegration-phases.yml
File metadata and controls
145 lines (129 loc) · 5.39 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Suivi des phases d'intégration
on:
issues:
types: [opened, closed, reopened, labeled, unlabeled]
pull_request:
types: [opened, closed, reopened]
workflow_dispatch:
permissions:
issues: read
pull-requests: read
contents: read
jobs:
rapport-phases:
name: Rapport d'avancement par phase
# Runners maison (groupe maison, Ubuntu 20.04, root) ; repli GitHub :
# variable NETCROSS_RUNS_ON_LEGER = '"ubuntu-latest"'.
runs-on: ${{ fromJSON(vars.NETCROSS_RUNS_ON_LEGER || '{"group":"maison","labels":["self-hosted","linux"]}') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Vérifier les fichiers de suivi
run: |
echo "## Vérification des fichiers de suivi" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
for f in docs/roadmap.md docs/issues-summary.md docs/features-backlog.md; do
if [ -f "$f" ]; then
echo "✅ \`$f\` présent" >> "$GITHUB_STEP_SUMMARY"
else
echo "⚠️ \`$f\` manquant" >> "$GITHUB_STEP_SUMMARY"
fi
done
- name: Générer le rapport d'avancement
uses: actions/github-script@v7
with:
script: |
const { data: openIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
per_page: 100
});
const { data: closedIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
per_page: 100
});
// Détecter les labels de priorité présents
const priorityLabels = ['P0-fondations', 'P1-différenciation', 'P2-exploitation', 'P3-applicatif', 'P4-admin', 'haute', 'moyenne', 'faible', 'bloqué', 'décision-produit'];
const priorityCounts = {};
for (const label of priorityLabels) {
priorityCounts[label] = openIssues.filter(i => i.labels.some(l => l.name === label)).length;
}
const diffLabels = ['diff-1-faible', 'diff-2-moyenne', 'diff-3-notable', 'diff-4-elevee', 'diff-5-expert'];
const diffCounts = {};
for (const label of diffLabels) {
diffCounts[label] = openIssues.filter(i => i.labels.some(l => l.name === label)).length;
}
const noPriority = openIssues.filter(i =>
!i.labels.some(l => priorityLabels.includes(l.name))
);
let prs = [];
try {
const prResult = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
prs = prResult.data;
} catch (e) {
// ignore
}
const lines = [];
lines.push(`## Rapport d'avancement — ${context.repo.owner}/${context.repo.repo}`);
lines.push('');
lines.push(`**Date** : ${new Date().toISOString()}`);
lines.push(`**Déclencheur** : ${context.eventName}`);
lines.push('');
lines.push("### Vue d'ensemble");
lines.push('');
lines.push('| Métrique | Valeur |');
lines.push('|----------|--------|');
lines.push(`| Issues ouvertes | ${openIssues.length} |`);
lines.push(`| Issues closes | ${closedIssues.length} |`);
lines.push(`| PRs ouvertes | ${prs.length} |`);
lines.push('');
// Section priorité
const activePriorities = priorityLabels.filter(l => priorityCounts[l] > 0);
if (activePriorities.length > 0) {
lines.push('### Issues ouvertes par priorité');
lines.push('');
lines.push('| Priorité | Nombre |');
lines.push('|----------|--------|');
for (const l of activePriorities) {
lines.push(`| ${l} | ${priorityCounts[l]} |`);
}
lines.push(`| Sans priorité | ${noPriority.length} |`);
lines.push('');
}
// Section difficulté
const activeDiffs = diffLabels.filter(l => diffCounts[l] > 0);
if (activeDiffs.length > 0) {
lines.push('### Issues ouvertes par difficulté');
lines.push('');
lines.push('| Difficulté | Nombre |');
lines.push('|------------|--------|');
for (const l of activeDiffs) {
lines.push(`| ${l} | ${diffCounts[l]} |`);
}
lines.push('');
}
if (noPriority.length > 0) {
lines.push('### Issues sans priorité');
lines.push('');
for (const i of noPriority) {
lines.push(`- #${i.number}: ${i.title}`);
}
lines.push('');
}
if (prs.length > 0) {
lines.push('### PRs ouvertes');
lines.push('');
for (const p of prs) {
lines.push(`- #${p.number}: ${p.title} (${p.head.ref})`);
}
lines.push('');
}
const fs = require('fs');
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, lines.join('\n') + '\n');