From 6ea8fc7f93ae2832fc541a8922bf351a0408087d Mon Sep 17 00:00:00 2001 From: WasserEsser Date: Mon, 22 Jun 2026 20:30:52 +0200 Subject: [PATCH] Skip non-existent Docker Hub tags instead of treating as patch failure --- .github/workflows/auto-tag.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 8402638..d22b5de 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -89,9 +89,21 @@ jobs: SUCCEEDED="" FAILED="" + SKIPPED="" for TAG in "${TAGS[@]}"; do echo "=== Testing Mattermost ${TAG} ===" + + # Check if the image tag exists on Docker Hub + HTTP_CODE=$(curl -sf -o /dev/null -w "%{http_code}" \ + "https://hub.docker.com/v2/repositories/mattermost/mattermost-enterprise-edition/tags/${TAG}" \ + || echo "$?") + if [ "$HTTP_CODE" != "200" ]; then + echo "Tag ${TAG} does not exist on Docker Hub, skipping" + SKIPPED="${SKIPPED}${SKIPPED:+', '}${TAG}" + continue + fi + if docker build --build-arg MATTERMOST_IMAGE_TAG="${TAG}" -t mm-test:"${TAG}" . ; then SUCCEEDED="${SUCCEEDED}${SUCCEEDED:+', '}${TAG}" git tag "${TAG}" HEAD @@ -112,6 +124,7 @@ jobs: echo "succeeded=${SUCCEEDED}" >> "$GITHUB_OUTPUT" echo "failed=${FAILED}" >> "$GITHUB_OUTPUT" + echo "skipped=${SKIPPED}" >> "$GITHUB_OUTPUT" - name: Notify on failure if: steps.build.outputs.failed != ''