Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
ci(images): guard that published images stay public and multi-arch
Jose Ramirez7bd15f2264f1
diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.ymlindex f1bbc4a40..dee2ce099 100644--- a/.github/workflows/ci-public.yml+++ b/.github/workflows/ci-public.yml@@ -354,6 +354,15 @@ jobs:- name: Validate service version bumpsrun: node scripts/release/validate-release-version-bumps.mjs --previous "${{ github.event.pull_request.base.sha || github.event.before }}"+ - name: Test the image manifest+ run: bash scripts/tests/test-images-manifest.sh++ - name: Test release image resolution+ run: bash scripts/tests/test-resolve-release-images.sh++ - name: Test release image promotion+ run: bash scripts/tests/test-promote-release-images.sh+# ─── Platform NGINX image guard (CVE baseline) ────────────────────────────nginx-image-guard:name: Validate platform NGINX imagesdiff --git a/.github/workflows/image-guard.yml b/.github/workflows/image-guard.ymlnew file mode 100644index 000000000..a4a00c43c--- /dev/null+++ b/.github/workflows/image-guard.yml@@ -0,0 +1,27 @@+name: Image guard++# Runs on dev, not on pull_request and not on main.+#+# Not pull_request: an image first exists only AFTER a merge to dev, so a+# PR-triggered guard would red-fail the very PR that adds an image, which can+# then never merge.+#+# Not main: main is far behind dev (33 commits at the time of writing), so a+# main-triggered guard fires roughly once per release, leaving a newly-private+# or amd64-only image to break the dev mirror for a full release cycle first.+on:+ push:+ branches: [dev]+ workflow_dispatch:++permissions:+ contents: read++jobs:+ guard:+ name: Published images are public and multi-arch+ runs-on: ubuntu-latest+ if: github.repository == 'evenfire-ai/evenfire'+ steps:+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4+ - run: node scripts/ci/check-image-visibility.mjsdiff --git a/scripts/ci/check-image-visibility.mjs b/scripts/ci/check-image-visibility.mjsnew file mode 100644index 000000000..8d591092f--- /dev/null+++ b/scripts/ci/check-image-visibility.mjs@@ -0,0 +1,62 @@+// Every published image must be anonymously pullable and multi-arch.+//+// This exists because control-ui was private for an unknown length of time and+// nobody noticed: new GHCR packages default to private, so any image added to+// the matrix lands private, and the first person to find out is a stranger+// whose setup dies on one ErrImagePull. The fix at the time was a manual UI+// click with no audit trail.+import process from 'node:process'+import { publishedImages } from '../release/images-manifest.mjs'++const NAMESPACE = 'evenfire-ai'+const ACCEPT = [+ 'application/vnd.oci.image.index.v1+json',+ 'application/vnd.docker.distribution.manifest.list.v2+json',+ 'application/vnd.docker.distribution.manifest.v2+json',+].join(', ')++async function token(image) {+ const url = `https://ghcr.io/token?scope=repository:${NAMESPACE}/${image}:pull&service=ghcr.io`+ const res = await fetch(url)+ if (!res.ok) return null+ return (await res.json()).token+}++const failures = []++for (const image of publishedImages()) {+ const t = await token(image.name)+ if (!t) {+ failures.push(`${image.name}: no anonymous pull token (the package is private)`)+ continue+ }+ const res = await fetch(`https://ghcr.io/v2/${NAMESPACE}/${image.name}/manifests/latest`, {+ headers: { Authorization: `Bearer ${t}`, Accept: ACCEPT },+ })+ if (!res.ok) {+ failures.push(`${image.name}: manifests/latest returned HTTP ${res.status}`)+ continue+ }+ const body = await res.json()+ // Every real index carries buildx attestation manifests reported as+ // unknown/unknown. Counting entries instead of filtering them makes an+ // amd64-only image look multi-arch.+ const arches = (body.manifests ?? [])+ .map(m => m.platform?.architecture)+ .filter(a => a && a !== 'unknown')+ if (!arches.includes('amd64') || !arches.includes('arm64')) {+ failures.push(+ `${image.name}: platforms are [${arches.join(', ') || 'none'}], expected amd64 and arm64`+ )+ }+}++if (failures.length > 0) {+ console.error(`::error::${failures.length} published image(s) failed the visibility/arch guard:`)+ for (const f of failures) console.error(` ${f}`)+ process.exit(1)+}++console.log(+ `all ${publishedImages().length} published images are anonymously pullable and multi-arch`+)