Repository navigation
Expand file tree
/
Copy pathtest-spring-release-train-project-ready.yml
More file actions
68 lines (59 loc) · 2.41 KB
/
Copy pathtest-spring-release-train-project-ready.yml
File metadata and controls
68 lines (59 loc) · 2.41 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
name: Test - Spring Release Train Project Ready
on:
push:
paths:
- '.github/actions/spring-release-train-project-ready/**'
- '.github/workflows/test-spring-release-train-project-ready.yml'
pull_request:
paths:
- '.github/actions/spring-release-train-project-ready/**'
- '.github/workflows/test-spring-release-train-project-ready.yml'
jobs:
# ── Validate action.yml structure ───────────────────────────────────────────
validate-action-yaml:
name: Validate action.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify action.yml is valid YAML and has required fields
run: |
node - << 'JSEOF'
const fs = require('fs');
const content = fs.readFileSync('.github/actions/spring-release-train-project-ready/action.yml', 'utf8');
let failed = false;
const requiredInputs = [
'project',
'spring-cloud-release-train-version',
'spring-release-train-version',
'token'
];
for (const input of requiredInputs) {
if (!new RegExp(`^ ${input}:`, 'm').test(content)) {
console.log(`❌ Missing required input: ${input}`);
failed = true;
}
}
if (!/using:\s+['"]?composite['"]?/.test(content)) {
console.log('❌ Action must use composite runner');
failed = true;
}
const stepNames = [...content.matchAll(/^\s+- name:\s+(.+)$/gm)].map(m => m[1].trim());
console.log('Steps found:');
stepNames.forEach(n => console.log(` - ${n}`));
const expectedSteps = [
'Resolve the project version and confirm it is unreleased',
'Checkout project release branch',
'Update project versions',
'Verify no snapshot versions',
'Commit and push changes',
'Trigger release-train-ready workflow',
];
for (const expected of expectedSteps) {
if (!stepNames.includes(expected)) {
console.log(`❌ Missing expected step: ${expected}`);
failed = true;
}
}
if (failed) process.exit(1);
console.log('✅ action.yml is valid and contains all required inputs and steps');
JSEOF