feat(supported-version): add service_preferences and support for php-fpm and nginx (#255)

This commit is contained in:
Damien Retzinger
2026-05-17 15:51:05 -04:00
parent 8e82fcc893
commit e89f6ad2e0
16 changed files with 642 additions and 47 deletions
+17 -2
View File
@@ -3,6 +3,7 @@ import { validateKind } from './kind/validate-kinds';
import { getMatrixForKind } from './matrix/get-matrix-for-kind';
import { validateProject } from "./project/validate-projects";
import { buildServicesForEntry } from "./services/build-services";
import { parseServicePreferences, validatePreferencesAgainstMatrix } from "./services/preferences";
export async function run(): Promise<void> {
@@ -12,19 +13,33 @@ export async function run(): Promise<void> {
const project = core.getInput("project");
const recent_time_frame = core.getInput("recent_time_frame");
const include_services = core.getInput("include_services") === "true";
const service_preferences_raw = core.getInput("service_preferences");
validateProject(<any>project)
validateKind(<any>kind, customVersions ? customVersions.split(',') : undefined);
const preferences = parseServicePreferences(service_preferences_raw);
const hasPreferences = Object.keys(preferences).length > 0;
if (!include_services && hasPreferences) {
throw new Error(
'service_preferences cannot be combined with include_services: false. Set include_services: true or clear service_preferences.'
);
}
let matrix = getMatrixForKind(kind, project, customVersions, recent_time_frame);
if (include_services) {
if (hasPreferences) {
validatePreferencesAgainstMatrix(preferences, matrix.include);
}
const workspace = process.env.GITHUB_WORKSPACE || '';
matrix = {
magento: matrix.magento,
include: matrix.include.map((entry) => ({
...entry,
services: buildServicesForEntry(entry)
services: buildServicesForEntry(entry, preferences, workspace)
}))
};
}
@@ -36,4 +51,4 @@ export async function run(): Promise<void> {
}
}
run()
run()