Please the all mighty linter

This commit is contained in:
Catalan Lover
2026-05-17 12:42:48 +02:00
parent ad70ec709d
commit e6cf833bcb
+24 -12
View File
@@ -15,33 +15,45 @@ module.exports = async ({ github, context }) => {
// Filter out the gate itself and third-party checks
const knownWorkflows = [
'GHCR - Development Branches', 'Docker Hub - Release', 'Docker Hub - Latest', 'Docker Hub - Develop',
'GHCR - Release', 'Tests', 'GHCR - Latest', 'Contribution requirements'
"GHCR - Development Branches",
"Docker Hub - Release",
"Docker Hub - Latest",
"Docker Hub - Develop",
"GHCR - Release",
"Tests",
"GHCR - Latest",
"Contribution requirements",
];
const relevantChecks = checks.data.check_runs.filter(check => knownWorkflows.includes(check.name));
const relevantChecks = checks.data.check_runs.filter((check) =>
knownWorkflows.includes(check.name)
);
// Check if ANY workflow is still running or queued
const incompleteChecks = relevantChecks.filter(check => check.status !== 'completed');
const incompleteChecks = relevantChecks.filter(
(check) => check.status !== "completed"
);
if (incompleteChecks.length > 0) {
console.log(`Waiting on ${incompleteChecks.length} checks... exiting for now.`);
console.log(
`Waiting on ${incompleteChecks.length} checks... exiting for now.`
);
return;
}
// Exclude skipped from failing the gate, treat success/neutral/skipped as OK
const allPassed = relevantChecks.every(check =>
['success', 'neutral', 'skipped'].includes(check.conclusion)
const allPassed = relevantChecks.every((check) =>
["success", "neutral", "skipped"].includes(check.conclusion)
);
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Workflow Gate',
name: "Workflow Gate",
head_sha: sha,
status: 'completed',
conclusion: allPassed ? 'success' : 'failure',
status: "completed",
conclusion: allPassed ? "success" : "failure",
output: {
title: 'Workflow Status',
summary: `${relevantChecks.length} workflow(s) evaluated: ${allPassed ? '✅ all passed' : '❌ some failed'}`,
title: "Workflow Status",
summary: `${relevantChecks.length} workflow(s) evaluated: ${allPassed ? "✅ all passed" : "❌ some failed"}`,
},
});
};