From 650644ebe3965c1756985e49b2a29f758a2ef12e Mon Sep 17 00:00:00 2001 From: mathias Date: Tue, 25 Aug 2026 08:53:23 +0000 Subject: [PATCH] ci(cd): call the shared build-image script instead of inlining it (infra#309) Same change as template-go-agent. A template that carries the build LOGIC manufactures a private fork of it in every generated repo; one that carries a CALL manufactures nothing. That distinction is what made infra#241 a nine-repo sprint plus two rediscoveries in the templates. Invoked as `bash .gitea/build-image.sh` -- files written through the Gitea API land 0644, and CI that depends on a file mode is a trap for every repo generated from here. --- .gitea/workflows/cd.yml | 59 ++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index b73d5cc..2c9699e 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -20,6 +20,10 @@ jobs: - uses: actions/checkout@v4 - id: detect run: | + # Grep the PLACEHOLDER, never the value substitution writes. A guard + # that greps its own substituted module path matches forever and + # skips every job below it -- see harg-bygglov-go#8, where that cost + # five weeks of empty green runs on a repo that never compiled. if grep -q '__MODULE_PATH__' go.mod; then echo "is_template=true" >> "$GITHUB_OUTPUT" else @@ -65,40 +69,29 @@ jobs: SHA=$(git rev-parse --short HEAD) echo "sha-tag=${SHA}" >> "$GITHUB_OUTPUT" + # infra#309: the implementation lives in .gitea/build-image.sh, a + # byte-identical copy of mathias/infra's ci-templates/build-image.sh. + # Do not edit it here -- edit the canonical file, run `task ci:sync`, + # and infra's drift gate will name any repo still carrying an old copy. + # + # This matters more in a template than anywhere else: every repo + # generated from here inherits its CI, so a template that carries the + # build LOGIC manufactures a new copy of every bug in it. That is + # precisely how rootless buildah (infra#241) reached a dozen repos, and + # why the fix then had to be rediscovered here weeks later. A template + # that carries a CALL manufactures nothing. + # + # NEW REPOS: add yourself to mathias/infra's ci-templates/adopters.txt so + # the gate keeps this copy current. Until you do, the copy is unmanaged + # and will silently fall behind. + # + # `bash