ci: prevent empty cicd-base tag in workflow
Some checks failed
Tests / Build and Push CICD Base Image (pull_request) Failing after 13m12s
Tests / Pyright Type Check (pull_request) Has been cancelled
Tests / Darglint Docstring Check (pull_request) Has been cancelled
Tests / No Docstring Types Check (pull_request) Has been cancelled
Tests / ESLint Check (pull_request) Has been cancelled
Tests / Prettier Format Check (pull_request) Has been cancelled
Tests / TypeScript Type Check (pull_request) Has been cancelled
Tests / Build and Push CICD Complete Image (pull_request) Has been cancelled
Tests / TSDoc Lint Check (pull_request) Has been cancelled
Tests / Backend Tests (pull_request) Has been cancelled
Tests / Frontend Tests (pull_request) Has been cancelled
Tests / Trailing Whitespace Check (pull_request) Has been cancelled
Tests / End of File Check (pull_request) Has been cancelled
Tests / YAML Syntax Check (pull_request) Has been cancelled
Tests / TOML Syntax Check (pull_request) Has been cancelled
Tests / Mixed Line Ending Check (pull_request) Has been cancelled
Tests / TOML Formatting Check (pull_request) Has been cancelled
Tests / Ruff Linting (pull_request) Has been cancelled
Tests / Ruff Format Check (pull_request) Has been cancelled
Tests / Backend Doctests (pull_request) Has been cancelled
Tests / Integration Tests (pull_request) Has been cancelled
Tests / End-to-End Tests (pull_request) Has been cancelled

This commit is contained in:
copilotcoder
2026-05-16 20:39:21 -04:00
parent bcb81ef99f
commit 726a339c82

View File

@@ -47,6 +47,11 @@ jobs:
run: |
echo "=== Checking if CICD Base Image Needs Rebuilding ==="
# Always compute hash first so downstream steps have a valid tag.
BASE_HASH=$(sha256sum Dockerfile.cicd-base | cut -d' ' -f1 | head -c16)
echo "Base Dockerfile hash: ${BASE_HASH}"
echo "base_hash=${BASE_HASH}" >> $GITHUB_OUTPUT
# Login to registry to check for existing image
if echo "${PACKAGE_ACCESS_TOKEN}" | docker login dogar.darkhelm.org -u "${REGISTRY_USER}" --password-stdin; then
echo "✓ Successfully logged into registry"
@@ -56,11 +61,6 @@ jobs:
exit 0
fi
# Calculate hash of base Dockerfile for cache key
BASE_HASH=$(sha256sum Dockerfile.cicd-base | cut -d' ' -f1 | head -c16)
echo "Base Dockerfile hash: ${BASE_HASH}"
echo "base_hash=${BASE_HASH}" >> $GITHUB_OUTPUT
# Try to pull existing base image with this hash (with timeout handling)
echo "Attempting to pull base image with hash: ${BASE_HASH}"
PULL_SUCCESS=false
@@ -103,6 +103,14 @@ jobs:
BASE_HASH: ${{ steps.check-base.outputs.base_hash }}
run: |
echo "=== Building CICD Base Image ==="
# Defensive fallback if output propagation failed for any reason.
BASE_HASH="${BASE_HASH:-$(sha256sum Dockerfile.cicd-base | cut -d' ' -f1 | head -c16)}"
if [ -z "${BASE_HASH}" ]; then
echo "❌ BASE_HASH is empty; refusing to tag/push invalid image references"
exit 1
fi
echo "Base hash: ${BASE_HASH}"
# Enable Docker BuildKit