From bff2d0e96a2ea197668ff4ab825ed45c3829e450 Mon Sep 17 00:00:00 2001 From: Thomas Gloor Date: Mon, 26 Oct 2026 12:41:31 +0100 Subject: [PATCH] Name the scan image after the run, not the commit A repo and its push mirrors build the same commit at the same time on the same Docker daemon. With the SHA in the temporary tag, one job removed the image the other was still scanning ("No such image: trivy-scan:-linux-amd64" in kj/scm-manager). Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/docker-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 95aab0d..686dd09 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -119,7 +119,9 @@ jobs: status=0 for platform in "${platforms[@]}"; do - tag="trivy-scan:${GITHUB_SHA}-${platform//\//-}" + # Unique per run: mirrored repos build the same commit at the same + # time on the same Docker daemon, so the SHA alone would collide. + tag="trivy-scan:${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-1}-${platform//\//-}" echo "::group::Build $platform" docker buildx build --platform "$platform" --load --pull \