mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-06-03 22:31:17 +00:00
5c8f6a30a1
Docker Hub - Develop / docker-latest (push) Failing after 1m0s
GHCR - Development Branches / ghcr-publish (push) Failing after 28s
Tests / Build & Lint (push) Failing after 3m43s
Tests / Unit tests (push) Successful in 3m4s
Tests / Integration tests (push) Failing after 15s
Tests / Application Service Integration tests (push) Failing after 12s
* Move all workflows to digest pinned versioning. * Infrastructure Upgrades for Automatic Reonvate CI PRs * Add minimum release age at 7 days for renovate CI updates
74 lines
2.6 KiB
YAML
74 lines
2.6 KiB
YAML
# SPDX-FileCopyrightText: 2026 Catalan Lover <catalanlover@protonmail.com>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: Workflow Gate
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- "GHCR - Development Branches"
|
|
- "Docker Hub - Release"
|
|
- "Docker Hub - Latest"
|
|
- "Docker Hub - Develop"
|
|
- "GHCR - Release"
|
|
- "Tests"
|
|
- "GHCR - Latest"
|
|
- "Contribution requirements"
|
|
types: [completed]
|
|
|
|
permissions:
|
|
checks: write
|
|
|
|
jobs:
|
|
gate:
|
|
runs-on: ubuntu-latest
|
|
if:
|
|
github.event.workflow_run.event == 'pull_request' ||
|
|
startsWith(github.event.workflow_run.head_branch, 'develop')
|
|
steps:
|
|
- name: Aggregate workflow status
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
|
with:
|
|
script: |
|
|
const sha = context.payload.workflow_run.head_commit.id;
|
|
|
|
// Get all check runs for this commit
|
|
const checks = await github.rest.checks.listForRef({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
ref: sha,
|
|
});
|
|
|
|
// 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'
|
|
];
|
|
const relevantChecks = checks.data.filter(check => knownWorkflows.includes(check.name));
|
|
|
|
// Check if ANY workflow is still running or queued
|
|
const incompleteChecks = relevantChecks.filter(check => check.status !== 'completed');
|
|
if (incompleteChecks.length > 0) {
|
|
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)
|
|
);
|
|
|
|
await github.rest.checks.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: 'Workflow Gate',
|
|
head_sha: sha,
|
|
status: 'completed',
|
|
conclusion: allPassed ? 'success' : 'failure',
|
|
output: {
|
|
title: 'Workflow Status',
|
|
summary: `${relevantChecks.length} workflow(s) evaluated: ${allPassed ? '✅ all passed' : '❌ some failed'}`,
|
|
},
|
|
});
|