1+ name : " Validate Matrix"
2+ description : " Validates generated matrix and returns feedback message"
3+
4+ inputs :
5+ matrix :
6+ description : " JSON matrix generated by generate-matrix action"
7+ required : true
8+
9+ outputs :
10+ isValid :
11+ description : " Whether the matrix is valid (not empty)"
12+ value : ${{ steps.validate.outputs.isValid }}
13+ message :
14+ description : " Feedback message about the validation result"
15+ value : ${{ steps.validate.outputs.message }}
16+
17+ runs :
18+ using : " composite"
19+ steps :
20+ - name : Validate Matrix
21+ id : validate
22+ uses : actions/github-script@v7
23+ with :
24+ script : |
25+ const matrix = JSON.parse(process.env.MATRIX || '[]');
26+
27+ // Check if matrix is empty
28+ const isEmpty = !matrix || matrix.length === 0;
29+
30+ if (isEmpty) {
31+ core.setOutput('isValid', 'false');
32+
33+ let errorMessage = "❌ **System test validation failed**\n";
34+ errorMessage += "\n";
35+ errorMessage += "The provided pipeline/profile names did not match any configured tests.\n";
36+ errorMessage += "\n";
37+ errorMessage += "**Available pipelines:**\n";
38+ errorMessage += "`acceptance`, `acceptance-helm`, `regression`, `regression-fg`, `regression-rbac`, `smoke`, `upgrade`\n";
39+ errorMessage += "\n";
40+ errorMessage += "**Available profiles:**\n";
41+ errorMessage += "`acceptance`, `azp_connect_mirrormaker`, `azp_dynconfig_listeners_tracing_watcher`, `azp_kafka_oauth`, `azp_kafka_upgrade`, `azp_kraft_upgrade`, `azp_operators`, `azp_rbac_remaining`, `azp_rolling_update_bridge`, `azp_security`, `brokers-and-security`, `operands`, `operators`, `smoke`\n";
42+ errorMessage += "\n";
43+ errorMessage += "Please check your command for typos and try again.";
44+
45+ core.setOutput('message', errorMessage);
46+ return;
47+ }
48+
49+ // Matrix is valid - create summary of what will run
50+ core.setOutput('isValid', 'true');
51+ core.info(`Matrix validation passed. ${matrix.length} job(s) will be executed.`);
52+
53+ const jobs = matrix.map(job => {
54+ const name = job.jobName || `${job.pipeline}-${job.profile || job.pipeline}-${job.arch}`;
55+ const agent = job.agent || 'default';
56+ const timeout = job.timeout || 'default';
57+ return `- **${name}** (${agent}, ${timeout}min)`;
58+ }).join('\n');
59+
60+ let successMessage = "✅ **System test validation passed**\n";
61+ successMessage += "\n";
62+ successMessage += `The following ${matrix.length} job(s) will be executed:\n`;
63+ successMessage += "\n";
64+ successMessage += jobs.replace(/\n/g, '\n') + "\n";
65+ successMessage += "\n";
66+ successMessage += "Tests will start after successful build completion.";
67+
68+ core.setOutput('message', successMessage);
69+ env :
70+ MATRIX : ${{ inputs.matrix }}
0 commit comments