This commit is contained in:
병준 박 2025-04-13 02:35:44 +00:00
parent c888806694
commit 8ea8327df8

View File

@ -15,7 +15,7 @@ spec:
- name: imageName - name: imageName
type: string type: string
description: Python version to use (e.g., 3.9, 3.11) description: Python image to use (e.g., python:3.9, python:3.11)
default: "python:3.11-slim" default: "python:3.11-slim"
workspaces: workspaces:
@ -24,7 +24,7 @@ spec:
results: results:
- name: version - name: version
description: Extracted project version (e.g. 0.2.0) description: Extracted project version with 'v' prefix (e.g. v0.2.0)
steps: steps:
- name: verify-tag - name: verify-tag
@ -43,7 +43,7 @@ spec:
TAG_FROM_REF=$(basename "$FULL_REF") # → v0.2.0 TAG_FROM_REF=$(basename "$FULL_REF") # → v0.2.0
echo "📄 Reading version from pyproject.toml..." echo "📄 Reading version from pyproject.toml..."
pip install tomli pip install --quiet tomli
VERSION=$(python3 -c 'import tomli; print(tomli.load(open("pyproject.toml", "rb"))["tool"]["poetry"]["version"])') VERSION=$(python3 -c 'import tomli; print(tomli.load(open("pyproject.toml", "rb"))["tool"]["poetry"]["version"])')
TAG_FROM_PROJECT="v${VERSION}" TAG_FROM_PROJECT="v${VERSION}"
@ -56,5 +56,5 @@ spec:
exit 1 exit 1
fi fi
echo "✅ Tag and version match: $VERSION" echo "✅ Tag and version match: $TAG_FROM_PROJECT"
echo -n "$VERSION" > /tekton/results/version echo -n "$TAG_FROM_PROJECT" > /tekton/results/version