Skip non-existent Docker Hub tags instead of treating as patch failure

This commit is contained in:
WasserEsser
2026-06-22 20:30:52 +02:00
parent 90de6b889f
commit 6ea8fc7f93
+13
View File
@@ -89,9 +89,21 @@ jobs:
SUCCEEDED="" SUCCEEDED=""
FAILED="" FAILED=""
SKIPPED=""
for TAG in "${TAGS[@]}"; do for TAG in "${TAGS[@]}"; do
echo "=== Testing Mattermost ${TAG} ===" 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 if docker build --build-arg MATTERMOST_IMAGE_TAG="${TAG}" -t mm-test:"${TAG}" . ; then
SUCCEEDED="${SUCCEEDED}${SUCCEEDED:+', '}${TAG}" SUCCEEDED="${SUCCEEDED}${SUCCEEDED:+', '}${TAG}"
git tag "${TAG}" HEAD git tag "${TAG}" HEAD
@@ -112,6 +124,7 @@ jobs:
echo "succeeded=${SUCCEEDED}" >> "$GITHUB_OUTPUT" echo "succeeded=${SUCCEEDED}" >> "$GITHUB_OUTPUT"
echo "failed=${FAILED}" >> "$GITHUB_OUTPUT" echo "failed=${FAILED}" >> "$GITHUB_OUTPUT"
echo "skipped=${SKIPPED}" >> "$GITHUB_OUTPUT"
- name: Notify on failure - name: Notify on failure
if: steps.build.outputs.failed != '' if: steps.build.outputs.failed != ''