Fix: Nur erreichbare Git-Tags für Version verwenden

This commit is contained in:
Hördle Bot
2025-12-14 14:28:39 +01:00
parent 25680a19b6
commit 9372264174

View File

@@ -24,12 +24,12 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Extract version: use build arg if provided, otherwise get from git, fallback to package.json
# Only use tags that are reachable from the current commit to ensure version matches the code
RUN if [ -n "$APP_VERSION" ]; then \
echo "$APP_VERSION" > /tmp/version.txt; \
else \
(git describe --tags --exact-match 2>/dev/null || \
git describe --tags --abbrev=0 2>/dev/null || \
git tag --sort=-version:refname | head -1 2>/dev/null || \
(grep -o '"version": "[^"]*"' package.json 2>/dev/null | cut -d'"' -f4 | sed 's/^/v/') || \
echo "dev") > /tmp/version.txt; \
fi && \