ci: use static matrices with change-based guards
Build containers / Compute changes (push) Successful in 3s
Build containers / fedora-cosmic (rawhide) (push) Failing after 1m10s
Build containers / fedora-remote (44) (push) Failing after 1m14s
Build containers / fedora-cosmic (44) (push) Successful in 13m5s
Build containers / Prune old releases and tags (push) Failing after 28s

Gitea does not expand a dynamic fromJson matrix (the job name stayed literal
and it queued with no matching runner). Instead, compute cosmic/remote booleans
in a changes job and gate static-matrix build jobs with job-level if.
This commit is contained in:
2026-09-27 23:14:13 +02:00
parent fdc1441c32
commit 8e85980468
3 changed files with 67 additions and 44 deletions
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Given changed paths on stdin, print `cosmic=<bool>` and `remote=<bool>` so the
# workflow can skip images that didn't change. Shared files or build tooling
# changes rebuild everything; empty input (schedule/manual) rebuilds everything.
set -euo pipefail
changed="$(cat || true)"
all=0
[[ -z "${changed}" ]] && all=1
grep -qE '^(build\.sh|release\.sh|prune-releases\.sh|prune-registry\.sh|ci-changes\.sh|\.gitea/)' <<< "${changed}" && all=1
grep -qE '^images/shared/' <<< "${changed}" && all=1
cosmic=false
remote=false
if [[ "${all}" == 1 ]]; then
cosmic=true
remote=true
fi
grep -qE '^images/fedora-cosmic/' <<< "${changed}" && cosmic=true
grep -qE '^images/fedora-remote/' <<< "${changed}" && remote=true
echo "cosmic=${cosmic}"
echo "remote=${remote}"