Fix grep for version number in docker build (#15699)

Grep now only returns _first_ result and "version" has to be at start of
line.
This commit is contained in:
Dylan
2025-01-23 13:14:58 -06:00
committed by GitHub
parent b5ffb404de
commit 90589372da

View File

@@ -51,7 +51,7 @@ jobs:
env:
TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag || 'dry-run' }}
run: |
version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
version=$(grep -m 1 "^version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
if [ "${TAG}" != "${version}" ]; then
echo "The input tag does not match the version from pyproject.toml:" >&2
echo "${TAG}" >&2