Refuse to promote a dev image whose version differs from the tag
Build, Scan & Publish Dev / build-scan-push (push) Successful in 13m14s
Publish Release Image / promote (release) Successful in 34s

release.yml never reads the repository, so a tag could be published for an
image reporting a different version, or for a stale dev image when the main
build had not landed yet.

Read package.json from the dev image before promotion and fail on mismatch.
This commit is contained in:
mdaleo404 committed 2026-11-13 07:45:40 +00:00
1 parent d95d19cd38
commit 3bb1884151
1 file changed
+12
+12
View File
@@ -42,6 +42,18 @@ jobs:
fi
echo "Promoting ${IMAGE}:dev -> ${IMAGE}:${TAG}"
- name: Verify dev image version
run: |
set -euo pipefail
VERSION="${TAG#v}"
IMAGE_VERSION="$(docker run --rm --network none --entrypoint cat "${SOURCE_REF}" /app/package.json | jq -r '.version')"
if [ "${IMAGE_VERSION}" != "${VERSION}" ]; then
echo "Refusing to release ${TAG}: the dev image reports ${IMAGE_VERSION}." >&2
echo "Wait for the main build to publish a fresh dev image, or set package.json to ${VERSION}." >&2
exit 1
fi
echo "Dev image reports ${IMAGE_VERSION}; promoting to ${TAG}."
- name: Promote image
run: |
set -euo pipefail