From 9c052be8650fb556e360be4a3ed2ad3fd560acf3 Mon Sep 17 00:00:00 2001 From: The412Banner <205237651+The412Banner@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:59:58 -0400 Subject: [PATCH] CI: re-pin the Debian image and stop the publish workflow replacing it (#501) The publish workflow's push trigger fired again on the branch's rebase and overwrote the release asset with a freshly compressed copy, so main's first build failed the checksum and fell back to the registry pull. The env file now pins the asset as published; the workflow is dispatch-only, defaults to a new tag, and refuses to replace an existing asset unless asked. --- .github/workflows/ci-debian-image.yml | 19 +++++++++++++------ tools/linuxfs/debian-image.env | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-debian-image.yml b/.github/workflows/ci-debian-image.yml index 1d7826f86b..1635ed4074 100644 --- a/.github/workflows/ci-debian-image.yml +++ b/.github/workflows/ci-debian-image.yml @@ -8,12 +8,13 @@ on: workflow_dispatch: inputs: tag: - description: 'Release tag to publish to' + description: 'Release tag to publish to (a new -rN tag for a refresh; builds pin the one in tools/linuxfs/debian-image.env)' required: true - default: 'ci-debian-bullseye-r1' - push: - branches: [ci/cache-debian-image] - paths: ['.github/workflows/ci-debian-image.yml'] + default: 'ci-debian-bullseye-r2' + replace: + description: 'Overwrite the asset if the release already has one (changes its checksum: re-pin it in debian-image.env)' + type: boolean + default: false permissions: contents: write @@ -26,10 +27,16 @@ jobs: - name: Pull, save and publish env: GH_TOKEN: ${{ github.token }} - TAG: ${{ inputs.tag || 'ci-debian-bullseye-r1' }} + TAG: ${{ inputs.tag }} + REPLACE: ${{ inputs.replace }} run: | set -euo pipefail image=public.ecr.aws/docker/library/debian:bullseye + # A published image is pinned by checksum in the build; never replace one by accident. + if [ "$REPLACE" != true ] && gh release view "$TAG" -R "$GITHUB_REPOSITORY" --json assets -q '.assets[].name' 2>/dev/null | grep -qx debian-bullseye.tar.zst; then + echo "::error::$TAG already carries debian-bullseye.tar.zst; publish to a new tag, or set replace and re-pin tools/linuxfs/debian-image.env" + exit 1 + fi for attempt in 1 2 3 4 5 6; do docker pull "$image" && break [ "$attempt" -lt 6 ] || { echo "::error::could not pull $image"; exit 1; } diff --git a/tools/linuxfs/debian-image.env b/tools/linuxfs/debian-image.env index 3224339474..5532bfe166 100644 --- a/tools/linuxfs/debian-image.env +++ b/tools/linuxfs/debian-image.env @@ -5,4 +5,4 @@ # refresh is only ever a new -rN release with the three lines below updated. DEBIAN_IMAGE_TAG=ci-debian-bullseye-r1 DEBIAN_IMAGE_ASSET=debian-bullseye.tar.zst -DEBIAN_IMAGE_SHA256=112aed723ccd2dc81d69a0ed8bb76b823ea28049fa56f72776f25d680bb36a00 +DEBIAN_IMAGE_SHA256=5ac13c6b0f2e3ab3e8acc8cadcd39ee453a51a72870645d592635e24bcb85459