chore(ci): guard the OCI build type=gha cache pattern #483
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/PMS-720-oci-gha-cache-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
type=ghamigration itself is already on main:.forgejo/workflows/build-oci-image.ymlalready creates adocker-containerbuildx builder (line 131), runscrazy-max/ghaction-github-runtime@v3to re-export ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN (line 139), and passescache_from = "type=gha"/cache_to = "type=gha,mode=max,ignore-error=true"(lines 159-165). The issue's background describes an older state of the file, so re-doing the migration would be a no-op; what is actually missing is the mechanical enforcement, and that is what this adds.Add
scripts/check-oci-build-cache.nu, wired intojust checkand the Check workflow next to the existing migration / mail-copy / runner-label guards. It asserts the invariant over every workflow that runsdocker buildx build: the docker-container driver, the runtime-env export step, andtype=ghacache_from/cache_to are all present, and the retiredtype=inline,type=registryand:buildcachebackends are absent. Comment lines are excluded because the workflow's own comments name the retired backends when explaining why they were dropped.The regression is otherwise invisible:
ignore-error=truemeans a dead or reverted cache still exits 0, and inline / registry caching also builds green, just slowly. Freshness has to be read from the build log'simporting cache manifest from ghaline, which nothing was checking.#PMS-720
#GOV-20